Hello,
In this little DarkShader example, the game will crash once a DarkAI command is used. Here is the code:
#include "DarkGDK.h"
#include "ShaderData.h"
#pragma comment ( lib, "shaderdata.lib" )
#include "DarkAI.h"
#pragma comment ( lib, "DarkAI.lib" )
void DarkGDK ( void )
{
dbSyncOn();
dbSyncRate( 0 );
dbShaderDataStart( );
AIStart();
dbMakeObjectSphere( 1, 10 );
dbAutoCamOff( );
AIAddEnemy(1);
dbMakeCamera( 1 );
dbColorBackdrop( 1, 0 );
dbLoadCameraEffect( "Bloom.dbs", 1, 0 );
dbSetCameraEffect( 1,1,1 );
dbMakeObjectPlain( 2, 2, 2 );
dbLoadEffect( "quad.fx", 2, 0 );
dbSetObjectEffect( 2, 2 );
dbMakeVector4( 1 );
dbSetVector4( 1, dbScreenWidth(), dbScreenHeight(), 0 , 0 );
dbSetEffectConstantVector( 2, "ViewSize", 1 );
dbDeleteVector4( 1 );
dbTextureObject( 2, 0, 1 );
while ( LoopGDK( ) )
{
dbPositionCamera( 1,dbCameraPositionX(0),dbCameraPositionY(0),dbCameraPositionZ(0) );
dbRotateCamera(1,dbCameraAngleX(0),dbCameraAngleY(0),dbCameraAngleZ(0) );
dbTurnObjectLeft( 1, 0.1 );
dbHideObject( 2 );
dbShowObject( 1 );
dbSyncCamera( 1 );
dbHideObject( 1 );
dbShowObject( 2 );
dbSyncMask( 0x001 );
AIUpdate();
dbSync( );
}
}
If you comment out the line "AIAddEnemy(1);", the game works perfectly. Is this a bug, or am I doing something dumb?
I am using Windows 7 64-bit, with a high end graphics card and specs, but I have duplicated this error on my older Windows XP machine, so I don't think this is a compatibility issue.
Please help me with this!