Question

I'd like to make use of OpenGL 3.0 features (framebuffer objects, 2D texture array), but the default OpenGL context created by Pyglet does not support these.

In the Pyglet source there is the following example: https://code.google.com/p/pyglet/source/browse/examples/opengl_3.py

Sadly, this example was last edited in 2008 and no longer seems to work (get_info() is not a context method anymore), and even the major_version and minor_version arguments don't seem to be used anymore.

What did work however, was using PyOpenGL in combination with Pyglet. Is this the only way to get access to OpenGL 3.0+? Whatever method I end up using, it has to work with Py2exe.

Was it helpful?

Solution

pyglet should automatically create the highest version context it can. Does your hardware/drivers support OpenGL 3?

$ python -c "from pyglet.window import Window; print(Window().context.get_info
().get_version())"
4.2.0

 

major_version and minor_version seem to work as well:

$ python -c "from pyglet.window import Window; \
             from pyglet.gl import Config; \
             print(Window(config=Config(major_version=3, minor_version=2))\
                     .context.get_info().get_version())"
3.2.0

 

get_info is still a Context method. What pyglet do you use?

get_info wasn't a Context method before pyglet 1.2, and there is no OpenGL 3 example with pyglet 1.1.

You should use pyglet 1.2 alpha (or the latest source).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top