Jump to content
Posted 01 December 2011 - 02:18 PM
Posted 01 December 2011 - 03:01 PM
I have been trying to figure out if I should cap the max. number of frames there bust be each second in my SDL game. All my animations is moves according to delta, and is not effected by the number of frames each second.
I would cap the FPS with SDL_Delay, I tested by looking at the windows 7 task manager how much CPU my game would use under different circumstances:
I first tested to see if indeed SDL_Delay also spared the CPU, by setting it to SDL_Delay(20000), and the CPU under "Processes" showed: 01.
With a cap on 60 FPS, the CPU showed around: 25.
With no cap the CPU showed around: 50.
I wonder if it is important to cap FPS. Gamers around the world brag about how many FPS there games play with, so I guess there isn't a CAP on those games.
So would you cap it? or let it run as many times as you would like?
a little extra curiosity question:
I noticed a game I made in SDL used 250.000K memory when running under winXP32bit, but when I switched to win7 it used 150.000k. I had a lot of images. But anyone know why the different on the to OS?
Posted 01 December 2011 - 05:21 PM
It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.
Posted 02 December 2011 - 02:38 AM
I'm sure there was a good reason for that when it was designed, but it makes it completely inappropriate for this use case. FPS capping using Sleep (i.e. SDL_Delay) calls also has the effect that you're limiting extra CPU availability for transient conditions that may need it.
Posted 02 December 2011 - 07:23 AM
Posted 09 January 2012 - 04:05 PM
My personal preference, if you really want to limit FPS, is to do so using vsync.