Posted: 9th Jun 2009 16:55
I have a problem loading the background, when i compile the project i get the background appear and then it flashes between that and a blue screen
any help would be greatfully recieved#include "DarkGDK.h"
#include "main.h"
// the main entry point for the application is this function
void DarkGDK ( void )
{
dbSetDisplayMode ( 775 , 500, 32 );
dbSetWindowTitle("3cardbragonline.com");
dbDisableEscapeKey ( );
dbSyncOn ( );
dbSyncRate(60);
// now we will set the random seed value to the timer, this will
// help us to get more random values each time we run the program
dbRandomize ( dbTimer ( ) );
while ( LoopGDK ( ) )
{
// here we check if the escape key has been pressed, when it has
// we will break out of the loop
game();
// here we make a call to update the contents of the screen
dbSync ( );
}
}
void game ( void )
{
GameSetup();
}
void GameSetup ( void )
{
dbSetImageColorKey ( 255, 0, 255 );
// in this application a backdrop is loaded and then several
dbSetWindowSize(720,427);
dbLoadImage ( "background.png", 1 );
dbLoadImage ( "table.png", 2 );
dbLoadImage ( "sprite.png", 3 );
dbLoadImage ( "sprite.png", 4 );
dbLoadImage ( "sprite.png", 5 );
dbLoadImage ( "sprite.png", 6 );
dbLoadImage ( "sprite.png", 7 );
dbLoadImage ( "sprite.png", 8 );
dbLoadImage ( "back11.png", 9 );
dbLoadImage ( "back11.png", 10 );
dbLoadImage ( "1kar9.png", 11 );
dbLoadImage ( "header1.png", 12 );
dbLoadImage ( "footer1.png", 13 );
dbLoadImage ( "menu2.png", 14);
dbLoadImage ( "Menu1.png", 15);
dbLoadImage ( "Look.png", 16);
dbLoadImage ( "stack.png", 17);
dbLoadImage ( "Bet.png", 18);
dbLoadImage ( "raise.png", 19);
dbLoadImage ( "up.png", 20);
dbLoadImage ( "amount.png", 21);
dbLoadImage ( "down.png", 22);
dbLoadImage ( "morechips.png", 23);
dbLoadImage ( "moreTime.png", 24);
dbLoadImage ( "1_2pot.png", 25);
dbLoadImage ("x4.png", 26);
dbLoadImage ("x3.png", 27);
dbLoadImage ("x2.png", 28);
dbLoadImage ("chatbox.png", 29);
dbLoadImage ("dealerbutton.png", 30);
dbLoadImage ("sprite.png", 31);
dbLoadImage ("sprite.png", 32);
dbLoadImage ("dollar.png",33);
// the next step is to create a sprite that uses this image, this
// is achieved by calling dbSprite and passing in a value of 1 for the
// sprites ID, 0 for the X coordinate, 0 for the Y coordinates and a
// value of 1 for the image
dbSprite ( 1, 0, 0, 1 );
dbSprite ( 2, 75, 60, 2 );
dbSprite ( 3, 25, 75, 3 );
dbSprite ( 4, 15, 170, 4 );
dbSprite ( 5, 470, 170, 5);
dbSprite ( 6, 460, 264, 6);
dbSprite ( 7, 460, 75, 7);
dbSprite ( 8, 25, 264, 8);
dbSprite ( 9, 713,300, 9 );
dbSprite ( 10, 653, 300, 10 );
dbSprite ( 11, 593, 300, 11 );
dbSprite ( 12, 0,0,12 );
dbSprite ( 13, 0,479,13);
dbSprite ( 14, 0,444,14);
dbSprite ( 15, 382, 412, 15);
dbSprite (16, 25, 446, 16);
dbSprite (17, 130, 446, 17);
dbSprite (18, 240, 446, 18);
dbSprite (19, 320, 446, 19);
dbSprite (20, 425, 446, 20);
dbSprite (21, 460, 446, 21);
dbSprite (22, 529, 446, 22);
dbSprite (23, 600, 446, 23);
dbSprite (24, 663, 414, 24);
dbSprite (25, 580, 414, 25);
dbSprite (26, 530, 414, 26);
dbSprite (27, 470, 414, 27);
dbSprite (28, 410, 414, 28);
dbSprite (29, 610, 22, 29);
dbSprite (30, dbMouseX(), dbMouseY(), 30);
dbSprite (31, 327, 305, 31);
dbSprite (33, 465, 455,33);
// when starting a Dark GDK program it is useful to set global
// application properties, we begin by turning the sync rate on,
// this means we control when the screen is updated, we also set
// the maximum rate to 60 which means the maximum frame rate will
// be set at 60 frames per second
dbSync();
return;
}