Here's a code of my loading screen..Its on the initialize function.
My loading screen doesn't work and i dont know why..
How do I make or implement a loading screen correctly?
#include "DarkGDK.h"
bool initialize();
void DarkGDK ( void )
{
dbSyncOn ( );
dbSyncRate ( 60 );
while ( LoopGDK ( ) )
{
if (!initialize()) dbText( 0, 0, "Initializing" );
dbXRotateCamera( dbCameraAngleX()+dbMouseMoveY()/5 );
dbYRotateCamera( dbCameraAngleY()+dbMouseMoveX()/5 );
if (dbUpKey()==1) dbMoveCamera( 10 );
if (dbDownKey()==1) dbMoveCamera(-10 );
//if (dbLeftKey()==1) dbMoveCameraLeft( 10 );
//if (dbRightKey()==1) dbMoveCameraRight( 10 );
dbPositionMouse( 200, 200 );
dbCenterText ( 200,400,"Loading was successful." );
char msg[250];
sprintf_s( msg, "Triangle Count: %d", dbStatistic(1) );dbCenterText ( 200,200, msg );
sprintf_s( msg, "Camera X: %.3f", dbCameraPositionX() );dbCenterText ( 200,220, msg );
sprintf_s( msg, "Camera Y: %.3f", dbCameraPositionY() );dbCenterText ( 200,240, msg );
sprintf_s( msg, "Camera Z: %.3f", dbCameraPositionZ() );dbCenterText ( 200,260, msg );
dbSync ( );
}
return;
}
bool initialize(){
static bool init_finished=false;
if (!init_finished){
dbLoadBitmap( "Cement.png",1);
dbPrint( "Now Loading..." );
dbHideMouse();
//dbMakeCamera(1);
//dbSetCurrentCamera(1);
dbLoadObject( "meow.x",1 );
dbSetCurrentBitmap(0);
init_finished=true;}
else
return true;
}
When a person has nothing but a dream, can he dare to dream.