Jump to content
  • Advertisement
Sign in to follow this  

This topic is 4462 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!