PDA

View Full Version : Display list initialization



yargerb
08-29-2001, 08:53 PM
I have written a parser for ASCII files and
the information is to be stored in a display
list. However, when the time comes to
define the display list's attributes glGenLists(1) returns 0. I have declared a variable of type GLint to accept the value returned by glGenLists. I can't figure out why it is always returning 0. I am coding in Visual C++ 6.0, and using glut routines. I don't think either has anything to do with this. Thoughts anyone? Thanks.

Korval
08-29-2001, 09:12 PM
Check your glError states. You can't call glGenLists between a glBegin and a glEnd.

yargerb
08-30-2001, 06:36 AM
That isn't the problem. I don't have any declarations to glGenLists() between glBegin() and glEnd(). Thanks

jxruan
08-30-2001, 10:41 AM
I think it may be a problem of rendering context. When applying for a list index, you must make sure that the current openGL rendering context and the window device context be valid. Did you put your code before openGL being set up?



Originally posted by yargerb:
I have written a parser for ASCII files and
the information is to be stored in a display
list. However, when the time comes to
define the display list's attributes glGenLists(1) returns 0. I have declared a variable of type GLint to accept the value returned by glGenLists. I can't figure out why it is always returning 0. I am coding in Visual C++ 6.0, and using glut routines. I don't think either has anything to do with this. Thoughts anyone? Thanks.

yargerb
08-31-2001, 12:09 PM
Thank you! That was it. I appreciate the help!