Hi guys, I'm the creator of PyGLy. Just thought I'd throw in my 2 cents.
I used Pyglet's GL wrapper and found it to be quite good.
It sticks to the python API which is nice, albeit c-like.
Pyglet's API uses ctypes... a lot.
Take a look at glGetIntergerv, and other functions.
>>> x = GLint()
>>> glGetIntegerv(GL_MAX_LIGHTS, x)
src = (c_char_p * count)(*strings)
glShaderSource(shader, count, cast(pointer(src), POINTER(POINTER(c_char))), None)
The main problem I had was that it doesnt support numpy directly.
I was unable to pass in mixed data types to buffers / textures, etc which can be important for efficient opengl coding
Quite often you need to pass float16, int16, int32's etc in the same buffer to OpenGL. This is mainly for meshes / animation.
In Pyglet, you need to pass in a ctype, this conversion mandates the values be the same type.
Ie, glBufferData( ..., (GLfloat * 100)(*floatArray), ... )
I tried for a while to fix this, but found no way (I'm not that experienced with python's ctype voodoo).
Perhaps you guys know of some method to do this (perhaps just 'np.array.data' would do the trick?).
Pyglet's core design is very... complex. It's overly OO and I found it incredibly difficult to follow.
A good example is the texture functions, tracing through them is a nightmare. Using them is overly complex too. You need to go through an Image object, then pull a GL texture object out of it.
The documentation can be really poor and I had a lot of trouble figuring out how to load a numpy array into a texture because this use case is just not found in the docs.
I had to monkey patch it to get OpenGL 3 working because Pyglet is OpenGL legacy down to the core windowing calls for mouse cursor rendering. This also meant I had to ditch all of pyglet's higher level fucntions because they are legacy based.
The idle loop had to be monkey patched too because it performs a render every time it clears the event queue, so moving your mouse on the window causes 100% cpu usage due to insane amounts of render calls.
I've also have problems with bugs in Pyglet.
OS-X support is not good. I had to fork Pyglet to get OpenGL 3.0 working on OS-X. I don't believe the patches have been applied after 6+ months.
PyOpenGL is supported by 99% of python gl windowing toolkits (Qt, PyGame, PyGLFW, etc.)
Even Pyglet works with PyOpenGL because the same OpenGL context is being used, so the calls are irrelevant.
You could perhaps use Pyglet's opengl calls while using another platform, but I found the extra dependency to be unneccessary.
PyOpenGL also supports numpy as a first class citizen, so I can now support mixed data types being allocated.
Most functions are wrapped in python and remove the need for ctypes and other c-type quirks like integer length, string length, returned value length, etc.
So platform independence and numpy support were big reasons to move away from pyglet.
This also meant dropping pyglet's event system. It's trivial to convert pyglet events to another event system with a wrapper.
This pythonic wrapping has a down-side, the documentation. This is the main problem with PyOpenGL.
The documentation is a copy of the opengl websites docs (albeit uglier).
Many OpenGL functions have been made more pythonic, but the signature changes are rarely documented and the quirks are NEVER documented.
For example, glBufferData - passing 0 for offset = crash, must pass None.
Other things like glGet being wrapped, some glGet functions are wrapped, some are still ctypes.
I used a LOT of trial and error to figure out the API calls I'm currently using.
I wanted to love pyglet because it's 100% python and simple to install, but it has cost me a lot of time and effort to get it working.
I'm thinking of using PyFLGW because its a simple wrapper, and the python bindings are trivial to patch.
It may not be appropriate for you guys, but ditching pyglet was the best thing I did.
Just hoping to provide some insight into the issues I've had over the last few years with pyglet, et al.
Cheers,
Adam