News
Workshop interne avec l’équipe de l’EPFL-ECAL-lab pour évaluer lubyk. Si tout va bien, on aura quelques démos à mettre en ligne…
Nous travaillons actuellement sur le spectacle des bateaux pour nulle part prévu pour l’automne 2012.
Damned GLUT threading
GLUT wants to be in control and hates being pushed in an obscure thread somewhere.
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.
2. We swap threads to make the opengl window the main thread.
3. Use another library.
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.