Porting to PyOpenGL 3.x from PyOpenGL 2.x
Written by
on
in
Snaking.
Just went through the process of porting PyUI to PyOpenGL 3.x. The changes were pretty trivial:
- was using glVertex2i but passing it doubles (Python floats from Pygame Rects), PyOpenGL 3.x doesn't allow that kind of silent auto-conversion (just for performance reasons related to adding the call to the wrappers, I'd be happy to have it, but it's too slow to do it in Python)
- was failing during glBegin/glEnd critical sections, and as a result was seeing failures when attempting to glEnable/glDisable features. PyOpenGL 2.x apparently wasn't checking for errors everywhere, but PyOpenGL 3.x does check and will raise errors.
- a number of aliases were missing for glColor, these were things like glColor3 and glColorub, which I'm really not all that happy about. I'm considering reverting the changes to add those two, as they wind up being extremely slow... that said, given that the whole of the single-vertex-based geometry sub-system is now deprecated, the aliases are only for legacy code.
Pingbacks
Pingbacks are closed.
Comments
Comments are closed.