Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Sync: Not always as simple as it seems

Author
Message
zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 1st May 2004 23:02
Hey all,

I understand the basics of how to use the sync command, and how to enable it,l but it isn't always intuitive. I had thought that all I would need to do is place the sync command (preferably at the end of the my main loop, and only once) that all would be good. Though this has not been the case for my programs and even the tuturials that come with DBPRO. I wind up through trial and error with sync commands throughout my program. Sometimes double stacked eg.. in adition to the sync in the main loop.

[some code, blah blah ...}
sync
sync
[more code..]

Is there actually logic to properly place the sync command? Shouldn't be only one call to sync at the end of the game loop? Why do I sometimes need to make two consecutive calls (one right after the first) to sync for things to work right? I hope someone can clear up my confusion. I hate just throwing random calls to sync without much logic to it.

Thanks

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 1st May 2004 23:56
We would need to see what you were doing, but yes, good code should only need one SYNC. It should be called every cycle.

BatVink
http://facepaint.me.uk/catalog/default.php AMD 3000+ Barton, 512Mb Ram, 120 Gig Drive space, GeForce 5200 FX 128 Mb, Asus A7N8X Mobo.
Terms & Conditions apply
Sparda
20
Years of Service
User Offline
Joined: 13th Jan 2004
Location: Pacifica
Posted: 2nd May 2004 04:32
Yes, you will only need one sync at the end of a game loop but only if you manually set the program for manual syncs. Or you could just set the sync rate and not have to worry about manually syncing.

There 10 kinds of people, those who understand binary and those who don't
Tim Ballisto
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Right behind you.
Posted: 2nd May 2004 04:48
just think of the sync command as the "Final Cut" everything is set up behind the scenes, and when the sync command appears, the program takes the picture and puts it on screen.


Programs for programmers.
Sparda
20
Years of Service
User Offline
Joined: 13th Jan 2004
Location: Pacifica
Posted: 2nd May 2004 07:13
Hey!!! Tim Ballisto, are you the same as timballisto who was registered on the Planet Rebirth website?

There 10 kinds of people, those who understand binary and those who don't
zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 2nd May 2004 08:40
Thanks for the all the help. I am playing around with a few examples and will post my findings.

I think my issue is expalained in the last sentence of the help file
for the "Sync" command.
Quote: "It is important to note the very first SYNC will only render
the back buffer and reveal the contents of that buffer on the second
SYNC command, as the system is based on a double buffered refresh."


Login to post a reply

Server time is: 2024-09-22 07:20:40
Your offset time is: 2024-09-22 07:20:40