PyOpenGL from spec almost there

Was stuck with no internet today, so the world gets a bit of work done on PyOpenGL...

So the branch in which PyOpenGL is generated directly from the Khronos API specification (xml) documents is almost workable. There are a lot of (internal) changes, particularly the OpenGL/raw APIs are pretty heavily rewritten, and I've landed a version of Roman Valov's patch that allows for proper extension querying on GLX (and EGL), as well as GL and GLU.  WGL support is still missing in the extension querying.

What the branch does have, however, is much more extensive coverage of all of the core APIs (GL, GLES, EGL, WGL and GLX), and in particular, much better coverage of the registered extensions for those APIs.  Basically every extension is auto-wrapped (though a few extension definitions fail due to the use of complex types for which I don't currently have a ctypes-compatible definition).

The structure of the raw APIs is now much more regular and rational (for the core APIs).  Each package has a _types.py module which defines the data-types the API needs/uses.  Each raw module just imports those types, the Constant class and the function-creation code, and defines the functions and constants for the api version or extension. The OpenGL/<API> modules just contain wrapper/convenience code, and the OpenGL/<API>/__init__.py module simply imports the VERSION module contents in order.

I've done some basic smoke-tests with the branch, and so far almost everything is working as expected (that is, it's API compatible with the last release), but I haven't tried to boot up Windows to get the WGL code running. Should anyone wish to play with it:

bzr branch lp:~mcfletch/pyopengl/xml-generation pyopengl
cd pyopengl
python setup.py develop

Should get you the code ready for testing.

Comments

Comments are closed.

Pingbacks

Pingbacks are closed.