OpenGL Error Checking

I have an OpenGL application and for some reason it freezes every time I run it. I’ve tried logging the error with LWJGL’s [icode]
Util.checkGLError()[/icode] but I get nothing. I’ve heard there are numerous ways of error checking; what are they? I can’t find any LWJGL related information on the matter.

Well I’ve never heard of an OpenGL error causing an application. Have you forgotten to call Display.update() at the end of the loop or something?

Did you forget to call update(true)?

Also you can use this code to check for GL errors:


int err;
        if ((err=GL11.glGetError()) != GL11.GL_NO_ERROR) {
            throw new UxException("OpenGL Threw Exception: " + err);
        }

Ahh yeah that was the problem. How embarrassing. Thanks for the snippet though, I’ll find it useful.

@Dxu1994 that code snippet is pretty much exactly the same except it throws a org.lwjgl.opengl.OpenGLException.

Edit: @Troubleshoots Don’t worry about it - we’ve all been there (in my case several times)