Jump to content
  • Advertisement
Sign in to follow this  
fredkreuger

Threading with SDL

This topic is 5103 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey all, I'm working on a simple game where I have multiple enemies on the screen, and have them all move independently. I figured the best way to do this would be with threads. Could anyone help with how to do this using SDL?

Share this post


Link to post
Share on other sites
Advertisement
No. Doing this with threads is NOT a good idea for several reasons.
1) you should have all of your enemies in a list and update each of them once per frame.

2) threads should be reserved for larger areas, for example, all of your network code should go into a seperate thread, sound should be called from another thread.

threads are used to simulate doing more than one thing at a time, and should be used for large intensive operations.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!