PDA

View Full Version : Display list question



mdog1234
01-14-2003, 11:39 AM
in a seperate function I have this

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

then in my display function I have this

glClear(GL_COLOR_BUFFER_BIT |GL_DEPTH_BUFFER_BIT);
glShadeModel(GL_SMOOTH);

glPushMatrix();
glRotatef(spin_x, 0.0, 1.0, 0.0);
glRotatef(spin_y, 1.0, 0.0, 0.0);
glCallList(List);
glPopMatrix();

cout<<gluErrorString(glGetError())<<endl;

glutSwapBuffers();


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

mikael_aronsson
01-14-2003, 12:05 PM
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.

Mikael

mdog1234
01-14-2003, 12:09 PM
ok thanks thats what I figured

Bob
01-14-2003, 12:40 PM
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.

Deiussum
01-14-2003, 02:05 PM
Are you making sure you create the list after you have a rendering context created?