What could be wrong with OpenGL calls? (ATI)

I’m constantly getting GL_INVALID_OPERATION after call to glEnd() on ATI 9600 Pro (drivers “1.5.4273 WinXP Release”).

I used GLIntercept tool to detect exactly where the error takes place.

Below are the few lines before returning GL_INVALID_OPERATION:

glBegin(GL_QUADS)
glGetError()=GL_NO_ERROR 
glVertex2f(4.000000,32.000000)
glGetError()=GL_NO_ERROR 
glVertex2f(496.000000,32.000000)
glGetError()=GL_NO_ERROR 
glVertex2f(496.000000,396.000000)
glGetError()=GL_NO_ERROR 
glVertex2f(4.000000,396.000000)
glGetError()=GL_NO_ERROR 
glEnd()
glGetError()=GL_INVALID_OPERATION

To me it looks like a stupid bug, but I might oversee something important.

You might also want to take a look at the full GLIntercept log file here

Thanks for help!

I had the same problem a few weeks ago. It turned out that I had a runtime error in my vertex program (Division by zero I think).
I don’t know if you are using vertex programs, but if you are, it might be worth checking.

By the way, I didn’t see the error on nVidia cards, as aparently they initialise temporary variables to zero (and I took advantage of that), which ATI doesn’t.

Anders

I’m not using any vertex & fragment programs (no GLSL either) and the problem I described doesn’t happen on nVidia cards I’ve tested too:(

Thanks.

Do not make glGetError() calls inside a glBegin()/glEnd() block. - This is a error and will be reported when the glEnd() block is called.

Quick google reference:
http://www.mevis.de/~uwe/opengl/glGetError.html

(Note: GLIntercept will not make automatic glGetError calls inside glBegin/glEnd blocks)