Frame rate handling

Started by
1 comment, last by irreversible 11 years, 2 months ago

Hello everyone,

I'm trying to write a simple game engine using SDL, but I have problems understanding the basics of the FPS concept. I've already read some tutorials on this but I still seem to be lost. Can anyone explain really simply to me how frame rate handling works?

Thank you all in advance.

Advertisement
Let's say we want 60 fps. 60 fps means 60 frames per 1000 milliseconds. That's around 16 or 17 milliseconds of time to update and render. If updating and rendering takes less than 16 milliseconds, then wait the remaining time to keep fps near 60.

Thats the gist of it. For further reading, check out an article called "Fix your Timestep!". It's more advanced, but don't let it confuse you.

Here's the "definitive" tutorial to go by: fixing your timestep.

This topic is closed to new replies.

Advertisement