I would suggest using agk::SetErrorMode(2); before loading anything as AppGameKit will skip
loading the image/object if the directory or name is not correct without throwing an error.
You may also want to think about error catching like checking if the file exists first before loading.
void app::Begin(void)
{
std::string szCurrentPlatform = std::string( agk::GetDeviceBaseName() );
if ( strcmp( szCurrentPlatform.data(), "android" ) == 0 )
{
isAndroidDevice = 1;
}
agk::SetWindowTitle( "Game Template App" );
agk::SetWindowSize( agk::GetDeviceWidth(), agk::GetDeviceHeight(), 0 );
agk::SetVirtualResolution ( agk::GetDeviceWidth(), agk::GetDeviceHeight() );
if ( isAndroidDevice == 1 )
{
agk::SetSyncRate(60, 0 );
}
else{
//Vsync does not work on Android.
agk::SetVSync( 1 );
}
agk::SetClearColor( 0,0,255 );
agk::SetOrientationAllowed( 0, 0, 1, 0 );
agk::SetScissor( 0, 0, 0, 0 );
agk::SetCameraRange( 1, 1, 50000 );
agk::SetCameraPosition(1, 0, 100.0, -250.0);
agk::SetCameraLookAt(1, 0.0, 50.0, 0.0, 0.0);
//agk::SetSunDirection( 0, -1, 1 );
agk::CreatePointLight( 1, 0, 200, 0, 1000, 255, 255, 255 );
//agk::SetAmbientColor( 60, 60, 60 );
agk::SetPrintSize( 22.0 );
agk::SetPrintColor( 255, 255, 0 );
agk::SetErrorMode(2);
if ( agk::GetFileExists( "SITDSText.png" ) == true )
{
int companyLogo = agk::LoadImage( "SITDSText.png" );
int backDropSprite = 99999;
agk::CreateSprite( backDropSprite, companyLogo );
agk::SetSpriteDepth ( backDropSprite, 10000 );
}
}
The coffee is lovely dark and deep,and I have code to write before I sleep.