[SDL] rendering from a different thread.

Solra Bizna sbizna at tejat.net
Thu Jan 3 14:46:16 PST 2008


On Jan 2, 2008 11:58 PM, Charles McGarvey <onefriedrice at brokenzipper.com> wrote:
> Anyone have any insights with using SDL & OpenGL with the rendering code and
> SDL_GL_SwapBuffers looping in a non-main thread?  Is this safe on all
> platforms?  Is this a good idea for a real-time rendering application like a
> game?  What are the pros/cons compared to drawing only in the main thread?
That should work on most platforms, but it's safest to have all the
graphics stuff in the main thread and the other things in their own
threads. You also need to make very sure that you're only doing
graphics stuff in one thread, because some OpenGL implementations go
absolutely drugged-squirrel psycho if you don't.
-:sigma.SB


More information about the SDL mailing list