Unfortunately, the current GL stack implementation crashes when calling it from different threads using multiple OpenGL contexts. As I required this specific functionality, I forked kazmath and implemented a TLS based context switch for the stack module (see http://github.com/starbugs/kazmath).
With my modifications, the only thing people have to do when they switch GL contexts is to call kmGLSetCurrentContext(void *) providing a reference to some external context representation that is constant for the lifecycle of a given real GL context. kazmath will then provide a stack for each context automatically (without any changes to the stack interface). My modifications merely require linking to libpthread.
Some background info: I am authoring a GL-based UI framework for iOS/Mac OS X which uses kazmath for most of the math and vector stuff (http://github.com/starbugs/icedcoffee). My modifications have been tested by a very small group of people currently experimenting with my framework -- no issues so far.
Anyway, I thought I just give you a ping and ask whether you're interested in pulling these changes? Maybe they are beneficial to others...
Unfortunately, the current GL stack implementation crashes when calling it from different threads using multiple OpenGL contexts. As I required this specific functionality, I forked kazmath and implemented a TLS based context switch for the stack module (see http://github.com/starbugs/kazmath).
With my modifications, the only thing people have to do when they switch GL contexts is to call kmGLSetCurrentContext(void *) providing a reference to some external context representation that is constant for the lifecycle of a given real GL context. kazmath will then provide a stack for each context automatically (without any changes to the stack interface). My modifications merely require linking to libpthread.
Some background info: I am authoring a GL-based UI framework for iOS/Mac OS X which uses kazmath for most of the math and vector stuff (http://github.com/starbugs/icedcoffee). My modifications have been tested by a very small group of people currently experimenting with my framework -- no issues so far.
Anyway, I thought I just give you a ping and ask whether you're interested in pulling these changes? Maybe they are beneficial to others...
Big thanks for the great library!
Tobias