Accurate Framerate ...

BlitzMax Forums/BlitzMax Programming/Accurate Framerate ...

Jeremy Alessi(Posted 2005) [#1]
If frameTimer + 1000 < MilliSecs()
    frameTimer = MilliSecs()
    frameRate = frameCounter
    frameCounter = 0
Else
    frameCounter:+ 1
EndIf


So I'm computing my frameRate with that ... seems to work fine. Except I can't get over 60fps ... if I remember correctly I'd want to use a Flip False in B3D to unleash the program from the refresh rate ... I can't seem to find a way to do this in BlitzMax. Is it possible?


Bremer(Posted 2005) [#2]
bglSetSwapInterval( 0 )


That should make it flip as fast as you can go through your code. If you eg. use 60, then it will try and do it 60 times per second.


Jeremy Alessi(Posted 2005) [#3]
Thanks!


Eikon(Posted 2005) [#4]
Using -1 for Graphic's hertz param will do the same.


Jeremy Alessi(Posted 2005) [#5]
Hmmm... yeah was going to say that doesn't work ... unless I don't use flip and instead use bglswapbuffers() in which case it goes super fast and I can't seem to limit it anyway.


Jeremy Alessi(Posted 2005) [#6]
LOL, I see ... I wasn't even paying attention to the way the new Graphics() function works! Thanks!


Bremer(Posted 2005) [#7]
Yes, bglSetSwapInterval( 0 ) only works together with bglswapbuffers(), forgot to mention that. I haven't really been using the max2d stuff but only openGL with bmax so far. :)