Jump to content
  • Advertisement
Sign in to follow this  
schattenmaennlein

SDL_delay for framerate

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

Im calculating the framerate like this: SDL_Delay(1000/FRAME_RATE); Now Ive heard SDL_Delay is instable to "system load changes"(whatever that is) and it is *only* 10ms exact. So is my code in any way a suboptimal solution and if why and how would I do it better?

Share this post


Link to post
Share on other sites
Advertisement
Chances are that you may not care for 100% CPU activity (as on a full screen game). Therefore, you can use a busy loop to get a very precise FPS regulation.

Share this post


Link to post
Share on other sites
I am too lazy to answer this again in such a short period of time, so check out this thread

Edit:

Quote:
Original post by schattenmaennlein
whats imperfect about a busy loop?


The obvious, you could be using those cycles you're stalling the CPU into useful things like calculating an A* path for example.

[Edited by - Kwizatz on October 2, 2007 7:38:23 PM]

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!