PyGame + PyOpenGl + ZBuffer?

Pete Shinners pete at shinners.org
Mon Sep 23 11:41:02 EDT 2002


Max wrote:
> I found my code is not working well in all computers: with a SiS 300/200
> graphic card, the Z buffer seems disabled.
> 
> The OpenGL initialization code is:
> 
> pygame.init()
> pygame.display.set_mode((640,480), OPENGL|DOUBLEBUF|HWSURFACE,32 )
> glEnable(GL_DEPTH_TEST)
> glDepthFunc(GL_LESS)
> glDepthRange(0,1)
> 
> How can I force Opengl to utilize ZBuffer?

pygame has a function to control extra setting for opengl. it must be
called before display.set_mode(). you'd probably want to pass something
like "pygame.display.gl_set_attribute(GL_DEPTH_SIZE, 16)". perhaps try
different sized depths?

http://pygame.org/docs/ref/pygame_display.html#gl_set_attribute


you might also try testing with GLUT, which usually builds with pyopengl.




More information about the Python-list mailing list