is there a way to show your fps?
Printable View
is there a way to show your fps?
You can try the following code that also shows fps:
http://www.exhedra.com/DirectX4VB/Tu...R_Lesson01.asp
If you want to measure FPS in a game, you could do like this:
You need the GetTickCount API for this
VB Code:
public sub checkFPS() dim lastCheck as long dim FPS as long dim tmpFPS as long lastCheck = getTickCount do tmpFPS = tmpFPS + 1 if gettickcount - lastcheck > 1000 then lastcheck = gettickcount fps = tmpFPS end if doevents loop
this is untested code, if it don't work, try to mix it a bit with a mixer:)
Each time you redraw, increment a variable:
Then, every second, swap that to another variable:Code:CurrentFPS=CurrentFPS + 1
That method works pretty well, though it's easy enough to improve.Code:If Int(Timer) <> Int(LastTimer) Then
DisplayFPS = CurrentFPS
CurrentFPS = 0
End If
LastTimer = Timer