   [SDL] Processing sdl events in a seperate thread
  Is it possible to poll for sdl events in a seperate thread?   
  Well, on this page it says "You can only call this function in the thread that set the video mode.". It also says "Often the need for calls to SDL_PumpEvents is hidden from the user since SDL_PollEvent and SDL_WaitEvent implicitly call SDL_PumpEvents".On this page it says "The video mode should be set by the Main Thread" - i.e. the thread that executes main().So it appears the answer is no.However, what you can do is have the main thread execute a SDL_WaitEvent() loop, with all the "heavy" processing occurring in other threads and all graphical calls made with inter-thread messages. This would require quite a bit of thought to work consistently, but it could work.Can you describe what you wish to do?   ;  I originally had code written where I was polling for events in a seperate thread, and broadcasting them to listening objects (observer pattern), it works, but half the time the program would crash would xlib errors. I finally figured out that it was because I was polling for events in a seperate thread. So now I am polling for the events in the main thread and sending the event to my event thread to be processed. I guess I am stuck doing it this way.   