Display list question

in a seperate function I have this

List = glGenLists(1);
glNewList(List, GL_COMPILE);
glVertexPointer(3, GL_FLOAT, 0, VertexData);
glDrawElements(GL_LINE_LOOP, size_of_poly, GL_UNSIGNED_INT, FaceData);

then in my display function I have this


glRotatef(spin_x, 0.0, 1.0, 0.0);
glRotatef(spin_y, 1.0, 0.0, 0.0);



Why am I getting the error invalid value. I know where I’m getting the error. Its comming from glCallList(List);

Hi !

Please notice the following from the glNewList documentation:

Certain commands are not compiled into the display list, but are executed immediately, regardless of the display list mode. These commands are glColorPointer, glDeleteLists, glDisableClientState, glEdgeFlagPointer, glEnableClientState, glFeedbackBuffer, glFinish, glFlush, glGenLists, glIndexPointer, glInterleavedArrays, glIsEnabled, glIsList, glNormalPointer, glPopClientAttrib, glPixelStore, glPushClientAttrib, glReadPixels, glRenderMode, glSelectBuffer, glTexCoordPointer, glVertexPointer, and all of the glGet routines.


ok thanks thats what I figured

Even though the vertex array commands are not stored in the display list, you can still build a display list from a vertex array. When compiling the display list, vertex arrays are dereferenced as if they are drawn, and moved into the display list. So there’s nothing wrong with your display list on that part.

Are you making sure you create the list after you have a rendering context created?