Problem with OpenGL and Threads

Mike C. Fletcher wrote:

Antony Hodgson wrote:
...

Thanks for your comment. As far as I can tell, PyOpenGL is threadsafe, although I don't know that for certain. Does anyone out there know?

PyOpenGL is all locked by the GIL, so it's pretty much thread-safe. However, there's a big difference between being thread-safe and working properly with background-thread rendering.

Yes, that is what I was trying to say but didn't have good terminology for it.

SetCurrent should bracket the SwapBuffers, but it also needs to bracket the rendering calls in the other thread, and you'll need to use a lock to prevent the buffer from switching or swapping during the background rendering. It *should* work to render in the background and then swap in the foreground, but as I say, I haven't tried it myself.

Ah, that makes a bit more sense.

ยทยทยท

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!