|
We are currently experiencing glut related crashes in rubyk. After some web reading, I found that Apple’s version of GLUT does is not at all thread safe and requires to live in the main thread. We knew our use of openGL was temporary due to the single window paradigm but we did not expect this bad news. We now have two choices: 1. We move all rubyk into a Cocoa interface with an NSOpenGLView and draw in there.
Both these solutions would be temporary to avoid crashes during the shows in two days. I think my Objective-C and Cocoa knowledge got a little too rusty to take the first route. The second route makes my bells ring. The last route generally means understanding some big elephant like SDL and I do not have the time or energy to do this now. Let’s try the second choice: swap threads. [edit] It was a mess to implement, especially the cleanup code to quit since the open gl glutMainLoop() never returns, I had to be tricky with the other threads and it was hard to avoid dead locks (I wait for you, you wait for me and nothing happens). I hope all this work (it’s 3 am) will avoid the nasty glut related crashes. |