Jump to content
  • Advertisement
Sign in to follow this  

This topic is 4553 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
    ++framesPerSecond;

    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
Advertisement
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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!