Jump to content
  • Advertisement

Archived

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

TheRealBartman

Where to place FPS check

This topic is 5582 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

Hey, My question is this: If I have a main loop similar to this:
  
while(!done)
{
     if(there is a message)
     {
          translate and dispatch it;
     }
     else
     {
          handle specific keypresses here
          else
          {
               rendering loop;
          }
     }
}
  
Should I grab the FPS inside of the rendering loop or should I grab it at the very end of the while loop? I noticed that when it is at the end of the while loop, and I move the mouse through the window or move it in fullscreen, the FPS more than doubles than if it were just sitting there. But if I put the check in the rendering loop, the FPS stays fairly constant. Thanks, Michael Bartman [edited by - TheRealBartman on February 8, 2003 9:32:21 PM]

Share this post


Link to post
Share on other sites
Advertisement
It doesn''t even matter. Of course you should take the time before you do any function calling ( rendering, input code, etc ) and then take the time after and then caluclate the fps and and render in the next rendering phase.
In the end it doesn''t even matter. if you conserned about it''s placment within a functino or not. Your prob banging your head over nothin.

Hope that helps...
Andy

Share this post


Link to post
Share on other sites
Neen10do:

It does it in fullscreen or window, it seems that when ever it processes any messages not handled that the frame rate jumps up.

Skillfreak:

I''m not sure what you mean by that, are there any papers that I could read documenting the concept you are describing? What function would be best for implementing that? GetTickCount()?

Thankyou,

Share this post


Link to post
Share on other sites
Take a look here (under First Steps) and find the timer related stuff. Maybe this well help?

Regards,
Sharky


[edited by - Sharky on February 9, 2003 7:38:34 AM]

Share this post


Link to post
Share on other sites

  • 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!