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.

DarkBASIC Professional Discussion / Have to move window for graphics to appear

Author
Message
AncientGamer
16
Years of Service
User Offline
Joined: 10th Jan 2010
Location: United States
Posted: 16th Aug 2011 14:25
With some programs, though not all, I have to actually click and drag the window to get the graphics to display. Here is one where I had to move the window. Any thoughts? Thanks!

sync on
hide mouse
sky=1000
make object sphere sky,300
scale object sky,-100,-100,-100
fog on
fog distance 100
fog color RGB(0,0,128)
maxBox=100
for boxVal=1 to maxBox
make object cube boxVal,5
position object boxVal, rnd(100), rnd(100), rnd(100)
next boxVal
position camera 50,50,0
sync
wait key
end
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 16th Aug 2011 15:26
You need one extra SYNC in there - the first SYNC doesn't display anything (due to double-buffering I believe).

Moving the window forces a redraw, in effect carrying out a partial SYNC.

AncientGamer
16
Years of Service
User Offline
Joined: 10th Jan 2010
Location: United States
Posted: 16th Aug 2011 19:11
Thanks, it works! Anything you can tell me on how I can know when I need to sync multiple times?
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 16th Aug 2011 19:57
There's no obscure rule for this - all syncs from the second one onwards will update the display.

TBH though, in the code you posted, I could have easily suggested remmoving the SYNC ON command.

Login to post a reply

Server time is: 2026-07-11 07:06:05
Your offset time is: 2026-07-11 07:06:05