The Debugger dumps me out here:
typedef void (__cdecl *ProtoLM_AddLightMapObject_3)(int32_t objectID, int32_t baseStage, int32_t dynamicLightMode);
void LM_AddLightMapObject(int32_t objectID, int32_t baseStage, int32_t dynamicLightMode) {
static ProtoLM_AddLightMapObject_3 Ptr;
if (!Ptr && !GDKLoadPtr(&Ptr,"LightMapper.dll","?LMAddLightMapObject@@YAXHHH@Z"))
return;
if (GDKWaitFunction()) {
Ptr(objectID, baseStage, dynamicLightMode);
GDKCleanupFunctionCall();
}
return;
}
While giving an error message
Quote: "Unhandled exception at 0x04495d4b in Program.exe: 0xC0000005: Access violation reading location 0x0e39f960."
I've made sure Darklights is authorized. Rebuilt gdkengine.dll
with plugins. Made sure UAC is off... And can't think of anything
else. The code I'm using is:
// Initialize DarkGDK by telling it where the engine dll is
if (!initDarkGDK("gdkengine.dll"))
{
return 1;
};
// Start other used dll's addons, etc.
LM_Start();
// Create a window
hWnd = openWindow(0, 0, 1024, 549, "Program",
WS_OVERLAPPED | WS_CLIPSIBLINGS | WS_CAPTION | WS_SYSMENU |
WS_CLIPCHILDREN, true);
// Attach the DarkGDK screen to the window
dbOpenScreen(hWnd, 0, 0, 1024, 549);
//Set the FPS
dbSyncRate( 60 );
//Since it's space, turn the backdrop off to appear black.
dbBackdropOff( );
// Create the sphere object
int ObjectSphere = dbCreateObjectSphere( 500, 147, 147 );
// Load the default Texture for the sphere
int DefaultTexture = dbLoadImage("media/Program/Textures/earth.png");
// Texture the object
dbTextureObject( ObjectSphere, DefaultTexture );
// Add light collision and light map
LM_AddCollisionObject( ObjectSphere );
LM_AddLightMapObject( ObjectSphere );
//Position the Object, Camera, and Light...
dbPositionObject( ObjectSphere, 0, 0, 0 );
dbPositionCamera( 250, 150, -700 );
LM_SetAmbientLight( 0.1f, 0.1f, 0.1f );
LM_SetAmbientOcclusionOn( 100, 5000, 0 );
LM_BuildCollisionData();
LM_BuildLightMaps( 2048, 0.1f, 3 );
// Show the window
ShowWindow(hWnd, SW_SHOW);
do
{
// Update the screen
dbSync();
}
while (windowEvent() != WM_CLOSE);
dbCloseScreen();
return 0;
};
System:
hp pavilion laptop
32bit Vista sp 2
VC++ Express 2008
DarkGDK 2.0 RC 4
any Feedback would be appreciated. I may be missing something from working on it so long. lol.
"imagination is more important than knowledge" -- Albert Einstien.