Sign in to follow this  

calculating game FPS

Recommended Posts

Hello guys, i've been looking for a method to calculate the FPS of my game, and regulate it, e.g. limit the FPS to 60, or something like that, i've seen such things in some directX wrappers ( engines, such as DarkGDK )

Share this post

Link to post
Share on other sites
that's confusing, do we stop the program after 60 frames until the second is over? wouldnt that make the game look "glitchy" if the computer renders the 60 frames in half a second, so you get half a second delay in every loop?

@ SDL example
//If we want to cap the frame rate
if( ( cap == true ) && ( fps.get_ticks() < 1000 / FRAMES_PER_SECOND ) )
//Sleep the remaining frame time
SDL_Delay( ( 1000 / FRAMES_PER_SECOND ) - fps.get_ticks() );

EDIT: nevermind, i think i got the point wrong, thanks for the links, mate.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this