Hey guys, when i try to debug my game i get this error/problem:
Unhandled exception at 0x005e5017 in 3D Game Testing.exe: 0xC0000005: Access violation reading location 0x0d6bf317.
It only happens when i try to load a .MDL object that i made in Gmax. I have checked that the file name in the code is correct and the object is where it should be, im not sure how to fix this problem or what i have done wrong. Please see my source code below.
// Dark GDK - The Game Creators - www.thegamecreators.com
// the wizard has created a very simple project that uses Dark GDK
// it contains the basic code for a GDK application
// whenever using Dark GDK you must ensure you include the header file
#include "DarkGDK.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 );
// makes the window as big as it can be
dbMaximizeWindow();
// hides the mouse pointer
dbHideMouse();
// makes a camera and turns off autocam
dbMakeCamera (0);
dbAutoCamOff();
dbPositionCamera(0, 0, 0);
// set the current directory to media
SetCurrentDirectory ("Media");
// loads the skybox
dbLoadObject ("skybox2.x", 1);
dbSetObjectLight (1, 0);
dbSetObjectTexture (1, 3, 2);
dbScaleObject (1, 5000, 5000, 5000);
dbPositionObject(1, 0, 0, 0);
// loads the ground object
dbLoadObject ("Concrete_Ground_1.MDL", 2);
dbPositionObject(2, 0, 0, 0);
// camera variables
float fCameraAngleX = 0.0f;
float fCameraAngleY = 0.0f;
// our main loop
while ( LoopGDK ( ) )
{
// moves the camera forward
if(dbKeyState(17) == 1)
{
dbMoveCamera(0, 4.0f);
}
// moves the camera backwards
if(dbKeyState(31) == 1)
{
dbMoveCamera(0, -4.0f);
}
// moves the camera left
if(dbKeyState(30) == 1)
{
dbMoveCameraLeft(0, 3.0);
}
// moves the camera right
if(dbKeyState(32) == 1)
{
dbMoveCameraRight(0, 3.0);
}
// create a rotation axis based on mouse movement
fCameraAngleX = dbWrapValue (fCameraAngleX + dbMouseMoveY() * 0.4f);
fCameraAngleY = dbWrapValue (fCameraAngleY + dbMouseMoveX() *0.4f);
// rotate camera
dbXRotateCamera(fCameraAngleX);
dbYRotateCamera(fCameraAngleY);
// update the screen
dbSync ( );
}
// return back to windows
return;
}
Any help would be apprectiated.
Troy