Hello again
Yes it is working with dummy objects and everything is very simple. But i have another problem - when the window goes to the windowed mode after fullscreen mode the window border disappear.
I am useing "dbSetWindowLayout ( 3, 0, 0 );" after changing the window mode but it not work.
Here is my code:
#include "DarkGDK.h"
bool fullscreen = false;
void load (void)
{
dbLoadImage ( "backdrop.bmp", 1 );
dbSprite ( 1, 0, 0, 1 );
for ( int i = 2; i < 30; i++ )
{
dbCreateAnimatedSprite ( i, "sprite.bmp", 4, 4, i );
dbSprite ( i, dbRnd ( 640 ), -dbRnd ( 1500 ), i );
}
}//load
void delete_ (void)
{
for (int i =1; i< 300; i++)
{
dbDeleteSprite (i);
}
}//delete_
void CreateCheckDummyObject (void)
{
dbMakeObjectBox (1, 1, 1, 1);
dbHideObject (1);
}//CreateCheckDummyObject
int CheckDummyObject (void) {return dbObjectExist(1) ;}
void CheckWindowState (void)
{
if (CheckDummyObject() == 0 )
{
delete_ ();
load ();
CreateCheckDummyObject ();
//fullscreen = !fullscreen;
}
}//CheckWindowState
void DarkGDK ( void )
{
dbSyncOn ( );
dbSyncRate ( 60 );
dbRandomize ( dbTimer ( ) );
dbSetWindowLayout ( 3, 0, 0 );
dbSetImageColorKey ( 255, 0, 255 );
load ();
CreateCheckDummyObject ();
//dbDrawSpritesFirst ();
while ( LoopGDK ( ) )
{
for ( int i = 2; i < 30; i++ )
{
dbMoveSprite ( i, -2 );
dbPlaySprite ( i, 1, 16, 60 );
if ( dbSpriteY ( i ) > 500 )
dbSprite ( i, dbRnd ( 640 ), -dbRnd ( 1500 ), i );
}
if ( dbEscapeKey ( ) )
break;
if (dbSpaceKey ())
{
if (!fullscreen)
{
delete_ ();
dbSetWindowOff ();
//dbMaximizeWindow ();
load ();
fullscreen = !fullscreen;
}
}//if
if (dbReturnKey ())
{
if (fullscreen)
{
delete_ ();
dbSetWindowOn ();
load ();
fullscreen = !fullscreen;
dbSetWindowLayout ( 3, 0, 0 );
}//if
}
CheckWindowState ();
dbSync ( );
}
for ( int i = 1; i < 30; i++ )
dbDeleteSprite ( i );
dbDeleteImage ( 1 );
return;
}
Dark GDK IS THE BEST!!!!