Display Lists

I have been working on getting a simple 3D framework up using SDL and OpenGL. I tried to set up a couple of display lists, however no matter where in my code I call glGenLists() it returns 0, even if I only try to generate 1 list. glGetError() returns a GL_INVALID_OPERATION error. This error code is, according to the documentation I have, supposed to be generated if glGenLists() is called between a glBegin() and glEnd, but I am not doing this. I am stumped.

Looks like you don’t have a valid rendering context at the point where you create your display list.

DOH!

Thanks, I was trying to call genLists too early in my code. That also fixed my access violation when quitting my demo. I was deleting the lists too soon, i.e. My draw function could possibly be called AFTER I had deleted my lists.