So as part of getting a PyOpenGL demo running on the Raspberry Pi I wrote a trivial subset of the Broadcom graphics interface api in ctypes. There's an (abandoned? not very recent, anyway) full wrapper in Cython, but even getting that compiled just took too long for me working on the Pi (far longer than writing a ctypes wrapper).
The little wrapper module needs work to be usable, but I don't really have the interest needed to do what needs to make it truly useful. What really seems to be needed is to take the 5 or 6 functions in the bcm library that actually relate to GL context creation/updating/destroying and an X library binding and make a simple tool that lets you overlay a bcm GL context on a given window in X.
When the X window moves/is resized/is hidden/etc the bcm window should be moved/resized/hidden. That would let people actually play with PyOpenGL in realistic Raspberry Pi environment (i.e. the default desktop running X windows) without really caring what GUI environment they are in. It would also let them use standard X mouse/keyboard handling from whatever environment they are using (pygame, wx, qt, raw X, whatever). I wasn't able to get pyqt running on my pi (it was apparently built for the wrong python), I did get Pygame running, but pygame itself doesn't AFAICS give you access to the window geometry (position on screen, shown/hidden state), and if we have to go down to X for it anyway, might as well make it generic.
That's not going to create a seamless GUI experience (the overlay will, for instance, show up in front of windows that should overlap it) but it might make it reasonable to get some basic OpenGL(ES2) running on the platform easily. If someone is interested, give me a shout and I'll push my little wrapper up.
Pingbacks are closed.