Page 1 of 1
1/2 VSYNC
Posted: Tue Dec 14, 2004 2:11 am
by Learner
Does anyone know if it is possible to get smooth motion(in this case a bouncing ball) without having to run the loop at 60 fps(if vtrace is 60). This
is mainly for slower machines.
i.e.
open windowed screen and init etc
monitor vert sync=60
SetFrameRate(30)
repeat
Start3D()
DisplaySprite3D(0,x,y,255)
Stop3D()
FlipBuffers()
Until Quit
The edges of the image is blury unless framrate is 60(= to vsync). Seems like flipbuffers is not properly syncing to retrace at less than 60 framerate. I dont understand why.
Thanks.

Posted: Tue Dec 14, 2004 2:46 am
by Blade
To have a smooth effect you should set monitor vert to 30 using SetRefreshRate, but doubt that many monitor would do that... I've never seen a monitor going lower than 50
Is it for a 3D or 2D graphics?
With 3D you have to use a lapsed-time movemente system to handle slower (or faster!) computers...
Perhaps this could be done even with 2D, but I've never tried.
1/2 vsync
Posted: Tue Dec 14, 2004 3:19 am
by Learner
Blade wrote:To have a smooth effect you should set monitor vert to 30 using SetRefreshRate, but doubt that many monitor would do that... I've never seen a monitor going lower than 50
Is it for a 3D or 2D graphics?
With 3D you have to use a lapsed-time movemente system to handle slower (or faster!) computers...
Perhaps this could be done even with 2D, but I've never tried.
Hi Blade, are you talking about something like:
While ( TimeGetTime_()-LoopTimer.f )<#LOOPTIME : Delay(1) : Wend
Tried to implement without any improvement.
Posted: Tue Dec 14, 2004 8:55 am
by Blade
No, I meant using "TimeGetTime_()-LoopTimer" to move every game element.
pseudocode:
dtime=TimeGetTime_()-LoopTimer
xship=xship + dtime * xmovement
where
- xship is the "ship" x coordinate
- xmovement is how much pixels the ship should move in a second
- dtime is the time, in seconds, since the previous frame. (usually <1 )
note 1 : delay() always to 1, or better, waiting the vblank
note 2 : I've never did this with PB, so I'm not use about commands
note 3 : this is not to make the graphic less blurry, it's for making the game elements to run always at the same speed in every computer.