1/2 VSYNC

Just starting out? Need help? Post your questions and find answers here.
Learner
User
User
Posts: 15
Joined: Tue Dec 14, 2004 1:32 am
Location: Australia

1/2 VSYNC

Post 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. 8)
Blade
Enthusiast
Enthusiast
Posts: 362
Joined: Wed Aug 06, 2003 2:49 pm
Location: Venice - Italy, Japan when possible.
Contact:

Post 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.
Learner
User
User
Posts: 15
Joined: Tue Dec 14, 2004 1:32 am
Location: Australia

1/2 vsync

Post 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.
Blade
Enthusiast
Enthusiast
Posts: 362
Joined: Wed Aug 06, 2003 2:49 pm
Location: Venice - Italy, Japan when possible.
Contact:

Post 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.
Post Reply