in reply to Re^4: Threads + OpenGL act weirdly?
in thread Threads + OpenGL act weirdly?
I would keep all things related to OpenGL within one thread, and preferrably the main thread. Have the OpenGL thread read from a Threads::Queue and write to another queue to process the events. You might have luck in that, at least on Windows, the GLUT callbacks won't interfere with the OpenGL drawing stuff, so you can of course try to instantiate these callbacks from within their own thread.
Also, for all things asynchronous, look beyond threads at POE, which is an event-based framework and at Coro, which uses userspace threads and thus circumvents almost all synchronisation problems. The author of Coro also writes Deliantra, a multi-user game using OpenGL, so likely you'll be able to use OpenGL with Coro.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Threads + OpenGL act weirdly?
by Xenofur (Monk) on Sep 28, 2008 at 18:31 UTC | |
by BrowserUk (Patriarch) on Sep 28, 2008 at 22:48 UTC | |
by Xenofur (Monk) on Sep 29, 2008 at 00:00 UTC |