SDL_delay for framerate
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?
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.
I care for a good cpu-activity because im fullscreen and have a lot of calculations going on. How do I do it and whats imperfect about a busy loop?
I am too lazy to answer this again in such a short period of time, so check out this thread
Edit:
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]
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]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement