Maybe the textures aren't in the working directory.
Just try this:
// whenever using Dark GDK you must ensure you include the header file
#include "DarkGDK.h"
#include "globstruct.h"
// the main entry point for the application is this function
void DarkGDK ( void )
{
// turn on sync rate and set maximum rate to 60 fps
dbSyncOn ( );
dbSyncRate ( 60 );
//turn backdrop off
dbBackdropOff ( );
//set camera sight distance
dbSetCameraRange ( 0.5f, 30000 );
// ********* CHECK IF THE TEXTURES ARE IN THE CURRENT WORKING DIR *********
if( !dbPathExist( "texture.jpg" ) || !dbPathExist( "detail.jpg" ) || !dbPathExist( "map.bmp" ) ) {
// the textures aren't in the working directory
MessageBoxA( g_pGlob->hWnd, "Cannot find one or more of the textures!", "Check the working dir", MB_OK | MB_ICONERROR );
// if the working directory is not correct then you need to set it up in the project properties page.
dbEnd( );
}
//load textures for ground
dbLoadImage ("texture.jpg",100);
dbLoadImage ("detail.jpg",200);
//set up the terrain
dbSetupTerrain ( );
dbMakeObjectTerrain ( 3 );
dbSetTerrainHeightMap ( 3, "map.bmp" );
dbSetTerrainScale ( 3, 3, 0.6, 3 );
dbSetTerrainSplit ( 3, 16 );
dbSetTerrainTiling ( 3, 4 );
dbSetTerrainLight ( 3, 1.0f, -0.25f, 0.0f, 1, 1, 0.78f, 0.5f );
dbSetTerrainTexture ( 3, 100, 200 );
dbBuildTerrain ( 3 );
//create the skybox
dbLoadObject ( "skybox2.x", 200 );
dbSetObjectLight ( 200, 0 );
dbSetObjectTexture ( 200, 3, 1 );
dbPositionObject ( 200, 1000, 2000, 4000 );
dbScaleObject ( 200, 30000, 30000, 30000 );
//position camera to start
dbPositionCamera (0, 0, 0);
// our main loop
while ( LoopGDK ( ) )
{
//update the terrain
dbUpdateTerrain ( );
// update the screen
dbSync ( );
}
// return back to windows
return;
}
01100001 01101110 01101111 01110100 01101000 01100101 01110010
01110000 01101111 01101001 01101110 01110100 01101100 01100101 01110011
01110011 01110011 01101001 01100111