Re: [PyOpenGL-Users] Documentation about configuring OpenGLContext
Brought to you by:
mcfletch
From: Mike C. F. <mcf...@vr...> - 2012-10-15 15:32:08
|
On 12-10-15 10:40 AM, Tómas Þór Jónsson wrote: > Hi, > > Is there any documentation about how to set, for example the window > size that TestContext creates? Or where on the screen it's positioned? > Basically stuff that in "old" OpenGL GLUT handles. The documentation is pretty fragmentary, basically you need to create a ContextDefinition object: http://pyopengl.sourceforge.net/pydoc/OpenGLContext.contextdefinition.html <http://pyopengl.sourceforge.net/pydoc/OpenGLContext.context.html> if __name__ == "__main__": from OpenGLContext import contextdefinition TestContext.ContextMainLoop( definition = contextdefinition.ContextDefinition( size = (800,500 ), ) ) which then is passed into the mainloop, which passes it into the context.Context() __init__ call. The various GL features (bit depths and the like) are controlled the same way. Each concrete Context sub-class (GLUTContext, PyGameContext, wxContext) then examines the ContextDefinition to set up the various features. The ContextDefinitions can be populated from a ConfigParser, should you want to do that. I'll try to add a bit of documentation about this stuff (and maybe make the API a little easier too) for the next OpenGLContext release. Thanks, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |