Where to place FPS check

Started by
4 comments, last by TheRealBartman 21 years, 2 months ago
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]
Michael BartmanLead ProgrammerDark Omen Studios
Advertisement
hmm thats a noodle scratcher... its not in full screen?

i code therefore i am.
----------------------i code therefore i am.Aero DX - Coming to a bored Monitor near you!
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
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,

Michael BartmanLead ProgrammerDark Omen Studios
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]
Thanks Sharky, that will be very helpful



Michael Bartman
Michael BartmanLead ProgrammerDark Omen Studios

This topic is closed to new replies.

Advertisement