Well, I uncommented everything, and I didn't get a crash:
#include "DarkGDK.h"
#include "shaderdata.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
dbShaderDataStart();
dbSyncOn ( );
dbSyncRate ( 60 );
dbSetDisplayMode(1024, 768, 32);
//dbReloadShaderDisplayPointer();
dbSetWindowPosition(0, 0);
dbAutoCamOff();
dbSetAmbientLight(25);
//
dbMakeCamera(1);
//
dbSyncMask( 1<< 0 );
dbMakeObjectCube(1, 5.0);
//dbLoadObject("skybox.x", 10);
dbMakeObjectSphere(10, 5.0);
dbScaleObject(10, 1000, 1000, 1000);
dbSetObjectLight(10, 0);
dbSetObjectCull(10, 0);
dbLoadImage("Colinas.jpg",10);
dbTextureObject(10,10);
dbRandomize(dbTimer());
//dbSync(); dbSync();
// these commands dont appear to do anything at all
const int iCubeMapID = 1;
dbMakeDynamicCubeMap(iCubeMapID, 512, 0);
dbApplyCubeMapToObject(1, 0, iCubeMapID, 0);
//
dbApplyCubeMapToObject(1, 1, iCubeMapID, 0);
//dbSync();//dbSync();
dbPositionCamera(0.0, 0.0, -15.0);
// our main loop
int nopress = 0;
char* buf;
while ( LoopGDK ( ) )
{
dbPositionObject(10, dbCameraPositionX(), dbCameraPositionY(), dbCameraPositionZ());
buf = new char[128];
if(dbDynamicCubeMapExist(iCubeMapID) == 1)
{
dbInk(dbRGB(255,0,0),0);
strcpy(buf, "This text should print if Dynamic Cube Map 1 exists");
dbText(0, 0, buf);
}
sprintf(buf, "dbCubeMapAvailable= %d" , dbCubeMapAvailable() );
dbText(0, 20, buf);
sprintf(buf, "dbMipCubeMapAvailable= %d" , dbMipCubeMapAvailable() );
dbText(0, 40, buf);
dbRotateObject(1, dbObjectAngleX(1)+1.0, dbObjectAngleY(1)+1.0, dbObjectAngleZ(1)+1.0);
dbControlCameraUsingArrowKeys(0, 2.0, 2.0);
//
dbSetCurrentCamera(-1);
// pass this objectID 1(the cube) will make it crash, no matter the other paramters...
// pass it object 0 or lower(invalid) and it runs and does nothing, regardless of other params
dbRenderDynamicCubeMap(0, 0, 0, 0, 0);
//
dbApplyCubeMapToObject(1, 0, iCubeMapID, 0);
//
dbSyncMask( 1 << 0 );
// update the screen
dbSync ( );
delete []buf;
}
// return back to windows
return;
}
The cube looks plain however. Don't know what should be exactly the desired result, I suppose it should mimic the skybox texture. Perhaps we are not using it like it should, but no crashes. Oh I'm not using DGDK 7.3, I use DGDK November08 when with VS2008.
I've included dbCubeMapAvailable and dbMipCubeMapAvailable checks to see if you got hardware support.
Side note: No worries about the SC libraries incompatibility with Dark Shader?