Drawing FPS

BlitzMax Forums/BlitzMax Programming/Drawing FPS

StormK(Posted 2011) [#1]
I am not sure what to think about the FPS given the following drawing test:
Graphics 600, 600

Repeat
	Cls
	
	For i : Int = 0 To 7000
		DrawRect 0, 0, 16, 16
	Next
	
	FPS.DrawFPS()
	
	Flip

Until AppTerminate()

Type FPS
	Global Counter : Int
	Global Time : Int
	Global TFPS : Int
	Function Calc : Int()
		Counter = Counter + 1
		If Time < MilliSecs()
			TFPS = Counter ' <-Frames/Sec
			Time = MilliSecs() + 1000 'Update
			Counter = 0
		EndIf
		Return TFPS
	EndFunction
	
	Function DrawFPS()
		DrawText "FPS = " + FPS.Calc(), 0, 0
	EndFunction
EndType


This test shows roughly 30 FPS. Is this slow, or is it normal? My computer specs are as follows:
Windows 7 Home Premium
Intel Core i3 CPU M 370 @ 2.40GHz 2.40 GHz
4.00 GB RAM
64-bit OS
Intel HD Graphics (Core i3)
Driver Version:		8.15.10.2361
Operating System:		Windows 7  Service Pack 1(6.1.7601)
DirectX* Version:		10.1
Physical Memory:		3884 MB
Minimum Graphics Memory:	32 MB
Maximum Graphics Memory:	1696 MB



TomToad(Posted 2011) [#2]
I'm running 60 FPS. With Flip False, I get 232 FPS. Is your driver locked at 30FPS possibly? Try it with Flip False and see what you get. Your system is actually a tad bit faster than mine, but otherwise, the specs are the same.


xcessive(Posted 2011) [#3]
I'm only getting about 160 fps. My computer seems to have some weird issues with drawrect().

UPDATE:
I get about 250 in DX7 mode, 160 in DX9 and 1000 in OpenGL.

Intel 980x CPU
12.00 GB RAM
TOXIC 5970 4GB
Windows 7 Ultimate.


Last edited 2011


StormK(Posted 2011) [#4]
Thank you for your replies; they have been helpful in gauging how well my system is performing. Currently everything is working!


Czar Flavius(Posted 2011) [#5]
As xcessive shows, the results can be very different accross the different drivers. Which driver did you use? On-board graphics chips are known to be very picky about such things. I had an old laptop whose on-board graphics barely supported OpenGL at all. 2fps in any game.


StormK(Posted 2011) [#6]
So I thought I got it to work, but it was apparently only working because I stopped drawing things that were not on screen. Revisiting the same code, the problem persists. It continues even into drawing textures. I am not sure why this is...I get well over 60fps in XNA.


col(Posted 2011) [#7]
Hiya. In your code, on a windows system, the default is the D3D9. Have you tried the other drivers by inserting 'SetGraphicsDriver D3D7Max2DDriver' or 'SetGraphicsDriver GLMax2DDriver' before the initial 'Graphics 600,600'. Also did you try with 'Flip False' ? What are your results?