Main Menu

Windows 7 and PB ScreenVSync

Started by stevmjon, October 28, 2011, 06:03:04 PM

Previous topic - Next topic

stevmjon

hi

i am not sure if this is a windows 7 thing, as this is the first time i have checked this when running my playbasic game with command screenvsync=on, in windows 7 home premium.

ScreenVSync On

fullscreen = good
window mode = choppy

i have been told that windows 7 displays the screen a little differently than windows xp etc.
i did check my nVidia settings and they are:  screen v sync = 3d application. i also set this to: screen v sync = on , with no difference.

any ideas or can anyone else confirm this.

  thanks in advance stevmjon
It's easy to start a program, but harder to finish it...

I think that means i am getting old and get side tracked too easy.

kevin

Quote
* Since enabling VSync makes your program refresh at the monitors refresh rate. Don't assume that other peoples computers will run at the same refresh rate as yours. Their monitor refresh could be set higher/lower than yours! So in those cases, your game with run faster or slower on such computers.

When Vsync is enabled, this causes a wait for top of frame between buffer flips, basically halting the entire machine until the vertical beam hits the top of frame position.   In a windowed mode, you have no control over the refresh rate, the users sets this.   So if the rate is set higher than you expect, then the game has less time between syncs, in other words, per refresh the game has less milliseconds to draw the frame and play nice with windows.  (60fps = 16.6 milliseconds, were as 75 only gives it 13.3 milliseconds)  When a frame takes too long, this will cause a drop (halving) in the frame rate. 

   The general way to tackle such things is through some type of Timer based movement (lots of article on the forums about this!), rather than frame based movement.  In TBM, the program assumes a desired refresh rate and moves objects based upon the time past, rather than at the physical refresh rate.   So when the game drops bellow the ideal frame, motion will be less smooth, but it doesn't drag.   

stevmjon

i did a comparison between windows 7 and windows xp, running the same project.

screenvsync = on

windows xp :
fullscreen = smooth
window mode = smooth

windows 7 :
fullscreen = smooth
window mode = choppy

   stevmjon
It's easy to start a program, but harder to finish it...

I think that means i am getting old and get side tracked too easy.

kevin