proper game timing

BlitzMax Forums/BlitzMax Programming/proper game timing

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Using 0 as the depth will open in a window mode. If you simply don't specify the Hertz, the Graphics command will use the default it seems. Figuring out what that default it is a bit trickier and not something I've looked into.

By default, I found, the Flip command is synchronized to the verticle-blank of the display refresh, because when doing speed tests I was getting sudden jumps from say 60fps to 30fps to 20fps to 15 fps to 10fps, etc, ... using bglSetInterval(0) seems to remove that synchronization, but I did find (as it says in the docs I think?) that it isn't compatible with ALL graphics cards or OpenGL implementations. In fact on my G4 iMac with a Radeon 4MX it ignores the (0) version but setting it to bglSetInterval(1) has the same effect.

As for adjusting the timing, I would think you may need to keep track of not only the time between the last frame finishing and the current frame's position, but also the time of the previous frame before that - because let's say the previous frame overran - you don't want to go wasting 3/4 of a frame doing nothing so you can pick up immediately where it left off and hopefully finish before the verticle blank.

Anyway, tinker. :-)