Sign in to follow this  

Threading with SDL

This topic is 4855 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
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

This topic is 4855 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this