SetGraphics "htz" doesn't work in fullscreen now?

Archives Forums/BlitzMax Bug Reports/SetGraphics "htz" doesn't work in fullscreen now?

The Caffeine Kid(Posted 2010) [#1]
Should say "Graphics" in the topic, sorry.

Back a few versions (I only have 1.33 installed here to test against at the moment) this worked fine and you could set any frame rate you like.

In the current version of Bmax it only seems to work in windowed mode and on switching to full-screen the game matches the windows refresh rate rather than the update rate given in the Graphics command.

Can someone please check and make sure it's not just me?

When did this change/break? It is still documented and should still work. :(


The Caffeine Kid(Posted 2010) [#2]
Global fps:Int=0,fpscounter:Int=0,secondcounter:Int
secondcounter=MilliSecs()

' test in a window - FPS should be 30
Graphics 640,480,0,30
Repeat 	
	If Abs(secondcounter-MilliSecs())>1000
		fps=fpscounter
		fpscounter=0
		secondcounter=MilliSecs()
	EndIf 	
	DrawText "Windowed Screen Test",10,10
	DrawText "Frames per second: "+fps,10,30
	DrawText "SPACE for next test.",10,50	
	fpscounter:+1	
	flip
	cls	
Until KeyHit(key_space)

' test in fullscreen - FPS should STILL be 30
Graphics 640,480,16,30
Repeat 	
	If Abs(secondcounter-MilliSecs())>1000
		fps=fpscounter
		fpscounter=0
		secondcounter=MilliSecs()
	EndIf 	
	DrawText "Full Screen Test",10,10
	DrawText "Frames per second: "+fps,10,30
	DrawText "SPACE to exit.",10,50	
	fpscounter:+1	
	Flip
	Cls	
Until KeyHit(key_space)


I get 30 in the first test but 60 in the second test. :(


xlsior(Posted 2010) [#3]
The '30' parameter in your sample refers to the Hz the video mode itself runs in, it does not magically slow down your screen updates.

Since your videocard won't support a 30Hz mode, it instead uses the default 60Hz refreshrate instead.

If you only want 30 redraws a second instead of 60, you'll need to do that in code instead.


The Caffeine Kid(Posted 2010) [#4]
I'm confused because it worked in previous version of Bmax.

That same code running in 1.33 (for example) works as intended.


Htbaa(Posted 2010) [#5]
That may be but with the latest releases we now have a DirectX9 driver. So that might be why it no longer works.


skidracer(Posted 2010) [#6]
See versions.txt for change to default flip behaviour.


The Caffeine Kid(Posted 2010) [#7]
I've gone back to 1.34 to compile my project because I didn't have time to code in my own frame rate limiting before it was due for submission.


Dreamora(Posted 2010) [#8]
You shouldn't switch versions mid development anyway as the behavior and potential bugs change. that makes any testing useless.