Sign in to follow this  

Recommended Posts

I calculated my fps like this:
static Timer	t;

static float framesPerSecond    = 0.0f;                            
static float lastTime            = 0.0f;                         
static float currentTime = t.getTime();                
static float printedFrames  =  0.0f;
    // Increase the frame counter

    if( currentTime - lastTime > 1.0f )
// Here we set the lastTime to the currentTime.  
//This will be used as the starting point for the next second.
        lastTime = currentTime;

        // Reset the frames per second
        printedFrames = framesPerSecond;
        framesPerSecond = 0;

Then I printed the printedFrames. But for some weird reason, I got the same framerate (60) when I drew my whole map, and when I drew nothing at all? Thanks.

Share this post

Link to post
Share on other sites
Yes, make sure to disable v-sync in your code. Also, make sure that vsync is set to "application Dependant" (or whatever) in you driver properties.

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