Java Code Examples for org.lwjgl.opengl.GL11#glGetError()

The following examples show how to use org.lwjgl.opengl.GL11#glGetError() . 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);
  }
}
 
Example 4
Source File: OffscreenRenderer.java    From tribaltrouble with GNU General Public License v2.0 4 votes vote down vote up
protected static void popGLState() {
	GLStateStack.popState();
	GL11.glPopAttrib();
	GL11.glGetError(); // FIXME: Swallow error because of bug in (at least) the r300 DRI drivers
}
 
Example 5
Source File: ImmediateModeOGLRenderer.java    From slick2d-maven with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
public void glGetError() {
	GL11.glGetError();
}