Archived

This topic is now archived and is closed to further replies.

kaizerzeta

Frame rate

Recommended Posts

bool LockFrameRate(int frame_rate) { static float lastTime = 0.0f; // Get current time in seconds (milliseconds * .001 = seconds) float currentTime = GetTickCount() * 0.001f; // Get the elapsed time by subtracting the current time from the last time // If the desired frame rate amount of seconds has passed -- return true (ie Blit()) if((currentTime - lastTime) > (1.0f / frame_rate)) { // Reset the last time lastTime = currentTime; return true; } return false; } its about double buffering, but i got confuse bout this frame rate. can someone explain me bout it and also what the heck is 0.0f?????

Share this post


Link to post
Share on other sites