Jump to content
  • Advertisement
Sign in to follow this  
Turold

Tearing problem

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

How to solve tearing problem in DX9, without slowing down main game loop to vsync speed? I thought about using separate thread for presentation, but I have zero experience with multithreaded coding and I'm not sure how to proceed.

Share this post


Link to post
Share on other sites
Advertisement
Tearing is solved by synchronizing to v-sync. Multi threading will not solve the problem. Since rendering more frames than the monitor can show is pointless, you can ignore the slowdown.

Share this post


Link to post
Share on other sites
I would like to have my main loop running at higher speed than 60Hz, thus I can't ignore this slowdown.

Share this post


Link to post
Share on other sites
You're correct. If you thread the rendering, you can lock that thread to v-sync, and have the rest of your game code run at whatever frequency is necessary.

One solution is to batch up rendering requests, and send them as discrete batches to the render pipeline (which could be running in another thread). For this type of approach you could use a producer-consumer pattern.

Check out: http://en.wikipedia.org/wiki/Producers-consumers_problem

Share this post


Link to post
Share on other sites
Quote:
Original post by Turold
I would like to have my main loop running at higher speed than 60Hz, thus I can't ignore this slowdown.


Why not set up a timer (use SetTimer in Win32 SDK) that renders every 16ms (60fps)?

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!