fps counter

Blitz3D Forums/Blitz3D Programming/fps counter

I see what you mean.

Heres the code again, with your framerate counter included (I hope correctly) However now I am getting results of 700+ Is this right???

ClearWorld
Graphics3D 800,600,32,0
SetBuffer BackBuffer()
AmbientLight 200,200,200


redcube=CreateCube()
PositionEntity redcube,10,10,10
EntityColor redcube,200,10,10

greencube=CreateCube()
PositionEntity greencube,5,5,15
EntityColor greencube,10,200,10

bluecube=CreateCube()
PositionEntity bluecube,15,5,15
EntityColor bluecube,10,10,200

toplight=CreateLight(1)
PositionEntity toplight,-20,40,20
PointEntity toplight,redcube

sidelight=CreateLight(1)
PositionEntity sidelight,30,10,10
PointEntity sidelight,redcube

cam=CreateCamera()
CameraViewport cam,0,0,800,600
PositionEntity cam,10,5,10
PointEntity cam,redcube
MoveEntity cam,0,0,-10

ms_passed = MilliSecs() 
Local fps 

	While Not KeyDown(1)

		TurnEntity redcube,1,0,0
		TurnEntity greencube,0,1,0
		TurnEntity bluecube,0,0,1

        If (MilliSecs() - ms_passed) >= 1000 
            ms_passed = MilliSecs()  
            fps = tot_frames 
            tot_frames = 0-1 
        EndIf 

tot_frames = tot_frames + 1

UpdateWorld 

RenderWorld 
					
		Text 0,260,"Frames Rendered Per Second: "+fps+"          "
		
		Flip

	Wend

ClearWorld
EndGraphics
End