PDA

View Full Version : what causes glGenLists to return th error "Invalid Operation"?



convict@large
11-01-2000, 01:24 AM
Does anyone know where I can find the full list of events or Gl States that would cause
glGenLists to return th error "Invalid Operation"?

As I'm trying to call it in a class that it #included into a windows OpenGL program, but its just returning the error. I'm calling it in the class constructor as well, should that make a difference? Do I need to have the device context etc for glGenLists to work? This is my first attempt at a display list.

Either that or what the requirments are for using glGenLists in a windows application?

Cheers,

Daniel

Inquisitor
11-01-2000, 02:35 AM
You MUST create a valid OpenGL rendering context before any OpenGL command will work. And don't forget to call wglMakeCurrent.
Placing OpenGL commands in a constructor is just as good as anywhere else.

convict@large
11-01-2000, 02:51 AM
Originally posted by Inquisitor:
You MUST create a valid OpenGL rendering context before any OpenGL command will work. And don't forget to call wglMakeCurrent.
Placing OpenGL commands in a constructor is just as good as anywhere else.

That will be the problem then as I'm declaring an instance of the class before I set-up any opengl stuff I'll move the display list generation stuff to the setup function and it should work. Thanks for clarifiing that for me.

Cheers,

Daniel