Re: Documentation about configuring OpenGLContext
"Mike C. Fletcher" <[email protected]>
| Newsgroups | gmane.comp.python.opengl.user |
|---|---|
| Message-ID | <[email protected]> |
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
------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
PyOpenGL Homepage
http://pyopengl.sourceforge.net