LWJGL Forum

Programming => OpenGL => Topic started by: chaosdeathfish on September 03, 2005, 01:47:14

Title: Checking for errors
Post by: chaosdeathfish on September 03, 2005, 01:47:14
I'm getting really irritated by error checking in LWJGL. In particular, it bugs me that I have to call glGetError() to find out if an error has occurred (i.e. I passed the wrong parameter to a method). I try to avoid using this to avoid the JNI overhead, but this means the error isn't reported until I call Display.update(), so I have to start putting Util.checlGLError() all through my code until I find the bug.

How about putting in each GL method an assert such as:
Code: [Select]
assert GL11.getGLError() != GL11.GL_NO_ERROR;
That way, we could just turn asserts on while developing to detect errors early, or switch them off for performance.