troubleshooting Question

SDL: threaded application design

Avatar of qff
qff asked on
Game ProgrammingC++Programming Theory
7 Comments2 Solutions670 ViewsLast Modified:
I'm making a game, programmed in C++ with SDL and some use of the boost libraries.
I am aware of the pitfalls of multithreaded application development (at least somewhat aware).

My plan is to have event-handling, drawing and game mechanics running in seperate threads.
I'm thinking about letting the event-handler spawn a new thread to make the appropriate response to a caught event - so the event-handler is not interrupted or halted for too long each time an event occurs.
Should I use SDL_WaitEvent or SDL_PollEvent in this case for checking events?

My question is whether I'm on a wrong trail here (am I doing it completely wrong?).
If you have any suggestions to improve my application design (or if you simply have a better one), I would love to hear them.
I'm currently planning to use SDL threads - would I be better of with boost.thread?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 2 Answers and 7 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros