How do I get OpenGL errors?

BlitzMax Forums/BlitzMax OpenGL Programming/How do I get OpenGL errors?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I open a valid display, and initialize all the OpenGL view ready to start drawing.

Then I do this:

repeat
until glGetError()=0  'wipe existing errors
glCopyPixels(0,0,8,8,GL_STENCIL)
If glGetError()>0 Then Print "Error copying in stencil buffer - no stencil buffer" Else Print "No error"


However, this always shows "No error", regardless of whether I have a stencil buffer available or not (as set up with flags in CreateGraphics().

How can I get the error? According to the OpenGL blue book, "GL_INVALID_OPERATION is generated if type is GL_STENCIL and there is no stencil buffer."

But I always get GL_NO_ERROR.

?????????