Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Dominik_78

OpenGL OpenGL & Threads

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

Is it okay to make my static Object movements and collision detection in an own thead? with Object movement I mean lasers/ships that goes through space and then check collision with each other. What have I to watch out for if I use a own thread for this. thank you Dominik

Share this post


Link to post
Share on other sites
Advertisement

Yes thats fine - you will have to synchronise whenever you reach a given time point (say, every frame, or whenever an objects movement has changed velocity for example).

There are various was to do safe data-transfer between threads, including semaphores - watch out for lock-ups though. Also, you will get a slight speed decrease with a single processor system due to context switching, but nothing too noticable.

Share this post


Link to post
Share on other sites
the main problem is my collision is not good on slow graphic cards. I just want to unbind the collision from the frames - and make 75 tests of collision and movement a seconds - and just render what is in the states - that i have to synchronice the acces to the data is something i have already learned in java :-) and i thought there must be something simmilar in C/C++.

hmm wouldn''t it be fine to even make the player input in this thread?

This would totaly unbind the frame rate from everything. just 2 threads 1 for data management and 1 for rendering.

Share this post


Link to post
Share on other sites

  • 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!