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 / Picture not showing during Sleep

Author
Message
Sir_Herbert
12
Years of Service
User Offline
Joined: 6th Nov 2013
Location: The InterWebz
Posted: 5th Mar 2014 19:23
I am trying to make a splash screen for my game. I heard that a simple way to make it work is to paste an object and then sleep the program for a few seconds. Well... the sleep works its the picture that doesn't. I use the paste image command and then sleep for 2000 milliseconds or 2 seconds. The program will sleep for that time but it is just a black screen. The image then shows up later when I add text. The paste part is at the top. Thanks ]

BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 5th Mar 2014 22:01
You need to SYNC before you sleep. Until then, the image is still in the buffer waiting to be transferred to the display.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 6th Mar 2014 01:02
Actually , you need at least two syncs. I usually put the first at the start so I don't forget it. The first one has something to do with the double buffering system used by DBPro.

For example:



Experiment with this simple code by adding/removing syncs and you'll soon see.



Powered by Free Banners
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 6th Mar 2014 16:57
Gandalf is as (mostly) always, correct.

Two syncs are required the first time.

Login to post a reply

Server time is: 2026-07-06 12:45:21
Your offset time is: 2026-07-06 12:45:21