Lost in graphics modes

BlitzMax Forums/BlitzMax Beginners Area/Lost in graphics modes

Vampyre(Posted 2010) [#1]
Hello again,

I know I know... Again... ;-) Now that my deltatime is working very nicely, I added a FPS counter, which show me a brilliant 60 FPS steady on my project. But... If I watch at the TimeLine FX demo game, Vaders, which can be found here (http://www.rigzsoft.co.uk/index.php?option=com_content&view=article&id=44&Itemid=25), down on the page, I can see that he also used a FPS timer, and that one just explodes my steady 60 fps... He is going near 2000 fps ! Which is a HUGE difference.

In his code, I can see he is using a different graphical mode (SetGraphicsDriver GLMax2DDriver()), which, If i try to load in my project, is simply non existing. I also tried to call in Framework brl.max2d, which is installed and compiled, but no better luck on my side, but his project do work.

My basic question here is : how the hell is he doing so fast FPS ?


GfK(Posted 2010) [#2]
He's doing it by ignoring vSync.

If you use vsync (i.e. the 'flip' waits for the next vertical blank before it actually happens), you will never be able to go faster than the default refresh rate of 60Hz.

Using Flip False will flip immediately (which can have some mild side effects that you shouldn't concern yourself with right now), but the end result is that your code will execute many times faster.

Ultimately though, TimelineFX does this to demonstrate the speed its code actually runs at. In a real-world scenario you wouldn't ever really need to draw the screen more than 60 times per second anyway.


Vampyre(Posted 2010) [#3]
Ok, so, the delta time provides here that it will always run at 60 frames / seconds steady, as I can have seen with my FPS timer. It will ensure the same speed on all machines. Faster will still be 60 frames / s steady, with more steps in between, while on an older machine, it will still be 60 frames / sec, with less steps in between... (now ok, I won't try it on a 386 DX 40) anyway, it would never reach 60 frames / sec.

Thanks for your answer, I'm not searching anymore to go faster than what I have right now... (human eye could not see the difference anyway).