Been debugging a weird error in GLUT this evening. Basically if you went into OpenGLContext and used a right-mouse-click-and-drag to rotate around the center-of-view, there would, every once in a while, be a seg-fault. It didn't happen if you rotated a bit more slowly, or you turned on full logging to see what's going on, basically it happened only if you were moving the mouse at the time you released the button...
OpenGLContext registers a handler on the right-mouse operation which creates an examination-mode event handler which lives solely for the duration of the drag, and which "captures" further mouse motions via (in the case of a GLUT context) GLUT callbacks. The right-mouse-up event de-registers the mouse-motion event handler.
Oops. Apparently it's possible for GLUT to produce mouse-move events for an event handler even after the mouse-motion event handler is de-registered. Seems the events are already in the GLUT queue, so they wind up running after the handler has been destroyed. Don't know why this only showed up now, but it's likely something I need to guard against at the PyOpenGL level. (Haven't figured out a clean way to do that yet, though, I'm thinking maybe of starting a GLUT timer which fires in X seconds and does the actual release of the Python-side function).
Other than this, the cleaned-up code generation using the Pyglet generator seems to be working for all of GL, GLU and GLUT. I should likely add GLE to the set and then see about committing the changes. In other PyOpenGL news, seems likely that we'll get access to the OpenGL 2.1 (or even 3.0) man-page docbook file for the documentation.
Pingbacks are closed.