FPS Counter
Posted: Sat Aug 02, 2003 8:54 am
I'm wondering how to perform a FramePerSecond (FPS) test :
I do it this way, is it OK ?
I do it this way, is it OK ?
Code: Select all
InitSprite()
InitKeyboard()
SetRefreshRate( 60 )
If OpenScreen( 640, 480, 16, "FPS" )
Repeat
FrameCounter + 1
If StartDrawing( ScreenOutput() )
DrawingMode(1)
FrontColor( 255, 255, 255 )
Locate( 300, 210 ) : DrawText( "fps test" )
Now = GetTickCount_()
If (Now-Ticks) > 999
Ticks = Now
FramePerSec.s = "FPS: " + Str( FrameCounter )
FrameCounter = 0
EndIf
Locate( 2, 2 ) : DrawText( FramePerSec )
StopDrawing()
EndIf
ExamineKeyboard()
FlipBuffers()
ClearScreen(0,0,0)
Until KeyboardPushed( #PB_Key_All )
EndIf
End