what causes glGenLists to return th error "Invalid Operation"?

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

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.

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