Original Post
🔒 Locked
Delay / Frames
Advertisement
Hi!
You just do something like that:
So if the rendering process finished before the given FPS count is reached, your application simply does nothing.
Bye, hunta
You just do something like that:
const int FPS = 1000/30;void Mainloop(void){ DWORD dwStartTime = GetTickCount(); // render your stuff while (GetTickCount()-dwStartTime < FPS) { // do nothing }}So if the rendering process finished before the given FPS count is reached, your application simply does nothing.
Bye, hunta
You can do what hunta posted, or you can move that same routine to the 'render' function of your game. If 'render' is called and the timer hasn't expired, then simply return control to your main gameloop instead of rendering the scene. That way your gameloop can be processing input and sound instead of simply 'stopping' until the timer expires.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement