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.

Dark GDK / why must use dbSync( ) two times ?

Author
Message
Can I use VC++ 6 with Dark GDK
16
Years of Service
User Offline
Joined: 8th Jan 2008
Location:
Posted: 2nd Mar 2008 14:28
why ? I must use dbSync( ) two times after I used dbSprite outside
GDK Loop ...

Why must two times ?

oh thanks..
Sephnroth
21
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 2nd Mar 2008 14:49
double buffered?

Can I use VC++ 6 with Dark GDK
16
Years of Service
User Offline
Joined: 8th Jan 2008
Location:
Posted: 3rd Mar 2008 04:33
I don't understand.. please explain to me

dbLoadImage( "bk.bmp", 1, 1 );
dbSprite( 1, 0, 0, 1 );
dbSync( );
dbSync( );
//why ? must use two times for dbSync( )


while( LoopGDK( ) )
{
.....
}
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 3rd Mar 2008 05:28 Edited at: 3rd Mar 2008 05:29
Because GDK uses a double bufffered rendering system, look it up. When you run any 3D or 2D commands with dbSyncOn() nothing happens, once you call dbSync() they get drawn to the backbuffer which is not visible to you, the 2nd time you call dbSync() the backbuffer gets flipped to the frontbuffer(what you see) which is why you need to use dbSync() twice to see anything. If you have a loop then you aren't required to use dbSync() at all before it, but it's better practice to.

Codger
21
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 3rd Mar 2008 05:29
Like many graphics system Dark GDK draws the graphics on a back buffers.
The system draws all graphics on the back buffer the screen you are watching is the front buffer.

The system switches the buffers every sync.

here is a detailed explaination


http://en.wikipedia.org/wiki/Double_buffering

Codger

ps, you need a sync in the while loop

System
PIV 2.8 MZ 512 Mem
FX 5600 256 mem

Login to post a reply

Server time is: 2024-09-29 13:31:06
Your offset time is: 2024-09-29 13:31:06