Seriously, why all the jitters and flashes?

Blitz3D Forums/Blitz3D Programming/Seriously, why all the jitters and flashes?

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.

Here's my 2c:

Not all machines work correctly with Flip or Vwait. While Flip may use a 50HZ interval, the true VSync Intervall of the monitor may be something diffrent, eg. 60Hz. So there will be an interferency, resulting in jittering motion and "cut off frames".

There is only one fool proof method, you need to measue Vwait, to see if it's working correctly. Something like:

vwait
t1=millisecs()
vwait
t2=millisecs()


vs=(t2-t1)

use_vsync=0
if vs>2
 ; vwait seems to work
 use_vsync=1
endif

...

; and inside the game loop:
if use_vsync=1
 vwait
 flip false ; use hardware-synchronized doublebuffering
else
 flip true ; use bruteforce 50 Hz doublebuffering
endif