Hey everyone! I seem to be getting this weird error whenever i compile and debug.
'Dark GDK - Game1.exe': Loaded 'C:\Documents and Settings\Brendan\My Documents\Visual Studio 2008\Projects\Dark GDK - Game1\Dark GDK - Game1\Debug\Dark GDK - Game1.exe', Symbols loaded.
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\winmm.dll'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\rpcrt4.dll'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\secur32.dll'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\gdi32.dll'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\user32.dll'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\d3dx9_35.dll'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\d3d9.dll'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\d3d8thk.dll'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\version.dll'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\dinput8.dll'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\dsound.dll'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\ole32.dll'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\msacm32.dll'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\wininet.dll'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\shlwapi.dll'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\normaliz.dll'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\urlmon.dll'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\oleaut32.dll'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\iertutil.dll'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\dplayx.dll'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\d3dxof.dll'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\shell32.dll'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\imm32.dll'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.5512_x-ww_35d4ce83\comctl32.dll'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\comctl32.dll'
'Dark GDK - Game1.exe': Loaded 'C:\Program Files\Spyware Doctor\smum32.dll', Binary was not built with debug information.
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\uxtheme.dll'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\msctf.dll'
'Dark GDK - Game1.exe': Loaded 'C:\Program Files\McAfee\SiteAdvisor\sahook.dll'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\msctfime.ime'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\hid.dll'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\setupapi.dll'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\wintrust.dll'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\crypt32.dll'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\msasn1.dll'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\imagehlp.dll'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\ntmarta.dll'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\samlib.dll'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\wldap32.dll'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\wdmaud.drv'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\msacm32.drv'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\midimap.dll'
'Dark GDK - Game1.exe': Loaded 'C:\WINDOWS\system32\ksuser.dll'
First-chance exception at 0x005f848e in Dark GDK - Game1.exe: 0xC0000005: Access violation reading location 0x00000008.
Unhandled exception at 0x005f848e in Dark GDK - Game1.exe: 0xC0000005: Access violation reading location 0x00000008.
Here is my actual source code:
// Dark GDK - The Game Creators - www.thegamecreators.com
// the wizard has created a very simple 3D project that uses Dark GDK
// it can be used as a starting point in making your own 3D games
// 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 )
{
// when starting a Dark GDK program it is useful to set global
// application properties, we begin by turning the sync rate on,
// this means we control when the screen is updated, we also set
// the maximum rate to 35 which means the maximum frame rate will
// be set at 35 frames per second
dbSyncOn ( );
dbSyncRate ( 35 );
//set up fall off point distance
dbSetCameraRange ( 1.0f, 30000.0f );
//load map textures
dbSetDir ( "media/textures" );
dbLoadImage ( "map texture.bmp", 1 );
dbLoadImage ( "map texture2.bmp", 2 );
dbLoadImage ( "detail.bmp", 3 );
//load and Save environment #1 and postion camera
dbSetupTerrain ( );
dbMakeObjectTerrain ( 1 );
dbSetTerrainHeightMap ( 1, "maph.bmp" );
dbSetTerrainScale ( 1, 3.0f, 0.6f, 3.0f );
dbSetTerrainLight ( 1, 1.0f, -0.25f, 0.0f, 1.0f, 1.0f, 0.78f, 0.5f );
dbSetTerrainTexture ( 1, 1, 3 );
dbSaveTerrain ( "Terrain1.dbt", 1 );
//Load and Save environment #2
dbSetupTerrain ( );
dbMakeObjectTerrain ( 2 );
dbSetTerrainHeightMap ( 2, "maph2.bmp" );
dbSetTerrainScale ( 1, 3.0f, 0.6f, 3.0f );
dbSetTerrainLight ( 1, 1.0f, -0.25f, 0.0f, 1.0f, 1.0f, 0.78f, 0.5f );
dbSetTerrainTexture ( 2, 2, 3 );
dbSaveTerrain ( "Terrain2.dbt", 2 );
//Load Skybox
dbSetDir ( "media/skybox/natural/pln" );
dbLoadObject ( "pln.x", 3 );
dbSetObjectLight ( 3, 0 );
dbScaleObject ( 3, 30000, 30000, 30000 );
//Camera Time
dbPositionCamera ( 0, 0, 0 );
// now we come to our main loop, we call LoopGDK so some internal
// work can be carried out by the GDK
;while ( LoopGDK ( ) )
{
dbText ( 0, 0, "Press 1 to use Terrain #1, and 2, for Terrain #2." );
if ( dbKeyState ( 1 ) )
dbBuildTerrain ( 1 );
if ( dbKeyState ( 2 ) )
dbBuildTerrain ( 2 );
//Setup Camera Controls
dbControlCameraUsingArrowKeys ( 0, 2.0f, 2.0f );
float fHeight = dbGetTerrainGroundHeight ( 1, dbCameraPositionX ( ),
dbCameraPositionZ ( ) );
dbPositionCamera ( dbCameraPositionX ( ), fHeight + 10.0f,
dbCameraPositionZ ( ) );
// update screen and terrain
dbUpdateTerrain ( );
dbSync ( );
}
// and now everything is ready to return back to Windows
return;
}
I setup a breakpoint on the line " dbUpdateTerrain ( ); ", and it works all the way through. So i have a feeling it has to do with something afterwords, just can't figure out what it is.
Any ideas what i did wrong?