I would suggest always putting in an error routine for programs. Things like corrupted files, bad filepath, etc. can all lead to immense frustration. Rather than just
assuming it will work, it is pretty easy to put in an error routine. For instance, here is your code with an error routine;
#include "DarkGDK.h"
#include <iostream>
void DarkGDK (void)
{
dbSyncOn();
dbSyncRate(60);
dbSetWindowOff();
dbSetDisplayMode(1260, 800, 16);
dbColorBackdrop(dbRGB(0, 0, 0));
if( !dbLoadImage("splash", 1) )
{
std::cerr << "Image was not loaded!" << std::endl;
return 1;
}
while (LoopGDK())
{
dbSprite(1, 300, 200, 1);
dbSync();
}
return 0;
}
This will exit the program with an exit code of '1' to indicate the program did not run. The std::cerr could then, with a little more work, be output to a log file should you so choose to see where the problem was.
It's a good habit to get into. You can use it for many different input methods;
if( !dbLoadObject( "filename", number )
std::cerr << "LoadObject failed!" << std::endl; return 0;
if( !dbOpenToRead( "filename" )
std::cerr << "OpenToRead failed!!" << std::endl; return 0;
Etc, etc, you get the idea =D
Cheers!
Tux is my guildmaster.