[SDL] SDL_Event threading all backwards?

Mason Wheeler masonwheeler at yahoo.com
Mon Feb 25 20:24:38 PST 2008


I'm trying to implement SDL_Events in my game engine and running up against a brick wall.  Everything I read on the subject gives two mutually exclusive recommendations:

1.  Managing SDL_Events has to be done from the application's main thread.
2. The most efficient way to manage SDL_Events is with the SDL_WaitEvent function.

This just won't work, because rendering also has to be done from the main thread.  I can't have my event loop stalling the rendering because the user isn't hitting any keys!  What kind of sense does it make to only have SDL_Events run on the main thread anyway, seeing as how the only sensible way to handle input in a multithreaded app using DirectX/OpenGL routines is in a different thread from the one doing the rendering?

Frankly, I don't see the logic to this.  Is there any way around it?

Mason Wheeler

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20080225/8897fb9e/attachment-0007.htm>


More information about the SDL mailing list