FPS again
well, the easiest way is to get the time lapsed during the frame, multiply by 1000 to get seconds, then divide that from the frame count (1). check out the code on my site for more ''advanced'' way to do it. here''s some pseudo:
while(!done)//game loop
{
start_time=timeGetTime();
do all game stuff;
end_time=timeGetTime();
fps=(1/(1000*(start_time-end_time))
}
for a more accurate reading you should span it over about 20 frames or so. once again, check out my class on my site for that.

How many Microsoft employees does it take to screw in a light bulb?
None, they just declare drakness as a new standard.
while(!done)//game loop
{
start_time=timeGetTime();
do all game stuff;
end_time=timeGetTime();
fps=(1/(1000*(start_time-end_time))
}
for a more accurate reading you should span it over about 20 frames or so. once again, check out my class on my site for that.

How many Microsoft employees does it take to screw in a light bulb?
None, they just declare drakness as a new standard.
My HomepageSome shoot to kill, others shoot to mame. I say clear the chamber and let the lord decide. - Reno 911
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement