Astan Chee wrote:
IIRC, this can happen if you call glGenLists *before* you create any
windows (or perhaps more accurately, before an OpenGL context has been
created).
Hi,
Im trying to do glGenLists while a program is running and it keeps
returning 0 and whenever I try to do a glCallList, it fails with a
'invalid value' error.
Is this a known issue? why would my program give valid glGenList while
being initialized but not while it is running?
>
Im trying to do glGenLists while a program is running and it keeps
returning 0 and whenever I try to do a glCallList, it fails with a
'invalid value' error.
Is this a known issue? why would my program give valid glGenList while
being initialized but not while it is running?
>
windows (or perhaps more accurately, before an OpenGL context has been
created).
Im using wx to create a new pygame thread that uses pyopengl. This is
the glGenList snippet:
>
dlBody = glGenLists(1)
glNewList(dlBod y,GL_COMPILE)
SphereT = gluNewQuadric()
gluSphere(Spher eT, 0.5, 32, 32)
gluQuadricNorma ls(SphereT, GLU_SMOOTH)
gluQuadricDrawS tyle(SphereT, GLU_FILL)
glEndList()
>
and here is how I init:
>
glShadeModel(GL _SMOOTH)
glClearColor(0. 0, 0.0, 0.0, 0.0)
glClearDepth(1. 0)
glEnable(GL_DEP TH_TEST)
glDepthFunc(GL_ LEQUAL)
glHint(GL_PERSP ECTIVE_CORRECTI ON_HINT, GL_NICEST)
>
glEnable (GL_LIGHT0)
glEnable (GL_LIGHTING)
glEnable(GL_TEX TURE_2D)
>
LightAmbient = ( (0., 0., 0., 0.,1.) )
glLightModelfv( GL_LIGHT_MODEL_ AMBIENT, LightAmbient )
>
glEnable(GL_COL OR_MATERIAL)
>
glViewport(0, 0, width, height)
glMatrixMode(GL _PROJECTION)
glLoadIdentity( )
gluPerspective( 45, 1.0*width/height, 1.0, 10000.0)
glMatrixMode(GL _MODELVIEW)
glLoadIdentity( )
>
>
the glGenList snippet:
>
dlBody = glGenLists(1)
glNewList(dlBod y,GL_COMPILE)
SphereT = gluNewQuadric()
gluSphere(Spher eT, 0.5, 32, 32)
gluQuadricNorma ls(SphereT, GLU_SMOOTH)
gluQuadricDrawS tyle(SphereT, GLU_FILL)
glEndList()
>
and here is how I init:
>
glShadeModel(GL _SMOOTH)
glClearColor(0. 0, 0.0, 0.0, 0.0)
glClearDepth(1. 0)
glEnable(GL_DEP TH_TEST)
glDepthFunc(GL_ LEQUAL)
glHint(GL_PERSP ECTIVE_CORRECTI ON_HINT, GL_NICEST)
>
glEnable (GL_LIGHT0)
glEnable (GL_LIGHTING)
glEnable(GL_TEX TURE_2D)
>
LightAmbient = ( (0., 0., 0., 0.,1.) )
glLightModelfv( GL_LIGHT_MODEL_ AMBIENT, LightAmbient )
>
glEnable(GL_COL OR_MATERIAL)
>
glViewport(0, 0, width, height)
glMatrixMode(GL _PROJECTION)
glLoadIdentity( )
gluPerspective( 45, 1.0*width/height, 1.0, 10000.0)
glMatrixMode(GL _MODELVIEW)
glLoadIdentity( )
>
>