Java Code Examples for org.lwjgl.opengl.GL11#GL_NO_ERROR

The following examples show how to use org.lwjgl.opengl.GL11#GL_NO_ERROR . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: OpenGLUtils.java    From OpenModsLib with MIT License 6 votes vote down vote up
public static Set<Integer> getGlErrors() {
	int glError = GL11.glGetError();

	// early return, to skip allocation
	if (glError == GL11.GL_NO_ERROR) return ImmutableSet.of();

	ImmutableSet.Builder<Integer> result = ImmutableSet.builder();
	do {
		result.add(glError);
	} while ((glError = GL11.glGetError()) != GL11.GL_NO_ERROR);

	return result.build();
}
 
Example 2
Source File: OpenGL3_TheQuadTextured.java    From ldparteditor with MIT License 5 votes vote down vote up
private void exitOnGLError(String errorMessage) {
    int errorValue = GL11.glGetError();
     
    if (errorValue != GL11.GL_NO_ERROR) {
        String errorString = GLU.gluErrorString(errorValue);
        System.err.println("ERROR - " + errorMessage + ": " + errorString);
         
        if (Display.isCreated()) Display.destroy();
        System.exit(-1);
    }
}
 
Example 3
Source File: DesktopComputeJobManager.java    From graphicsfuzz with Apache License 2.0 4 votes vote down vote up
private void checkError() {
  final int errorCode = GL11.glGetError();
  if (errorCode != GL11.GL_NO_ERROR) {
    throw new RuntimeException("GL error " + errorCode);
  }
}