Hello all, I've been working on a simple game using the Sprite and MoveableSprite objects from the Gaddis textbook, and I'm having a weird issue getting my Sprite background to draw properly. If I could show you some examples...
void DarkGDK()
{
dbSyncOn();
dbSyncRate(REFRESH);
// Game loop
while( LoopGDK() )
{
Sprite titleImg(TITLE, TITLE, "title.jpg");
titleImg.display(0,0);
dbSync();
}
}
The above code works perfectly and simply displays my image as a sprite background. However, if I add a conditional, something gets upset. Changing the contents of the game loop to this...
// Game loop
while( LoopGDK() )
{
if(true)
{
Sprite titleImg(TITLE, TITLE, "title.jpg");
titleImg.display(0,0);
}
dbSync();
}
...gives me nothing but a black screen. Obviously I'd like to make that conditional something relevant to the game, but I don't understand why it's not drawing the background even when the conditional always passes. I feel like I'm making a really silly error, or that there is something about the sync function that I don't understand. Thanks for any help you can provide!