|
FPS |
Anne M
Member #3,421
April 2003
|
How can I get the FPS my game in Allegro is running on? |
Evert
Member #794
November 2000
|
At each frame drawn, increment a variable (your frame counter) by one. There are other ways (measure the time it takes to draw x frames and display x/time, for instance), but this is how I do it. |
miran
Member #2,407
June 2002
|
Or if you code in C++ you can use my FPS class:
You use it in your main loop like this:
I know it's not optimal but it works just fine for me... -- |
Trezker
Member #1,739
December 2001
|
A class for fps! That's something I'd call overkill. |
StevenVI
Member #562
July 2000
|
Quote: A class for fps! That's something I'd call overkill. I know, eewwwwwwww!!! Reusable code! Yick!!! GET IT AWAY FROM ME!!!!!!!! How else are you supposed to count frames? Get out a stopwatch and start counting on your fingers? Alternatively, and I think much more efficiently, if you're using Windows, and wanna say "Screw portability" because you're evil like that, you can look up the QueryPerformanceCounter function on MSDN (I think that's what it's called.. if not, it's something very very similar .) -Steve __________________________________________________ |
|