Window.update() => OpenGLException: Invalid enum (1280)

Started by TrnsltLife, May 08, 2004, 04:06:43

Previous topic - Next topic

TrnsltLife

Anybody have any idea what this error is?  I'm trying to compile the NeHe tutorials that I got from somewhere in this forum:  I had to update the code to .9, mostly just changing GL. to GL11. , and updating the import statments.  But in Lesson07 and Lesson08, I also changed:

GL11.glLightfv to GL11.glLight, e.g.:
GL11.glLight(GL11.GL_LIGHT1, GL11.GL_AMBIENT, (FloatBuffer)temp.asFloatBuffer().put(lightAmbient).flip());   

I'm not sure if that's relevant, but the already-compiled Lesson07 and Lesson08 ran, while my newly compiled one does not run.  There are no compile-time errors, just this one runtime error:

org.lwjgl.opengl.OpenGLException: Invalid enum (1280)
       at org.lwjgl.opengl.Util.checkGLError(Unknown Source)
       at org.lwjgl.opengl.Window.update(Unknown Source)
       at Lesson08.main(Lesson08.java:63)

Any clue what could cause this?

Orangy Tang

OpenGL gets checked for errors at the end of every frame, so you don't have to :) Basically 'somewhere' in your rendering code / previous frame you've used the wrong constant/enum to an OpenGL call (my personal pet mistake is confusing GL_PROJECTION and GL_PROJECTION_MATRIX etc.)

Easiest way to track it down is to just comment out huge chunks of code until you narrow it down to the individual method call. And don't forget to check your init code as well, odds are it's happening on the first frame.

cfmdobbie

If you like, post the whole code and see if anyone can spot the problem immediately.
ellomynameis Charlie Dobbie.