Alright, so I've re-installed DarkGDK, and... I'm still getting a compiler error. I guess it must be something with my code (and the samples) that are causing this to bug up. Here's what I'm using:
#include "DarkGDK.h"
void DarkGDK ( void )
{
dbSyncOn ( );
dbSyncRate ( 0 );
dbMaximizeWindow();
dbSetCameraRange ( 1.0f, 300000.0f );
dbLoadImage ( "texture.jpg", 1 );
dbLoadImage ( "detail.jpg", 2 );
dbSetupTerrain ( );
dbMakeObjectTerrain ( 1 );
dbSetTerrainHeightMap ( 1, "map.bmp" );
dbSetTerrainScale ( 1, 3.0f, 1.0f, 3.0f );
dbSetTerrainLight ( 1, 1.0f, -0.25f, 0.0f, 1.0f, 1.0f, 0.78f, 1.0f );
dbSetTerrainTexture ( 1, 1, 2 );
dbBuildTerrain ( 1 );
dbLoadObject ( "skybox2.x", 2 );
dbSetObjectLight ( 2, 0 );
dbScaleObject ( 2, 30000, 30000, 30000 );
dbSetObjectTexture ( 2, 3, 1 );
dbPositionCamera ( 385, 23, 100 );
float Gravity = 0.25;
float FallSpeed = 0;
float Y = 0;
float vSpeed = 0;
float lastY = dbGetTerrainGroundHeight ( 1, dbCameraPositionX ( ), dbCameraPositionZ ( ) );
bool CanJump = true;
int speed1 = 0;
while ( LoopGDK ( ) )
{
if (dbShiftKey())
speed1 = 6.0;
else
speed1 = 1.0;
dbControlCameraUsingArrowKeys(0,speed1,4);
float TerrainHeight = dbGetTerrainGroundHeight ( 1, dbCameraPositionX ( ), dbCameraPositionZ ( ) );
if ((TerrainHeight > Y) || (Y - TerrainHeight < Gravity * 1.5) || (Y == TerrainHeight))
{
Y = TerrainHeight;
FallSpeed = 0;
vSpeed = 0;
CanJump = true;
}
else
{
FallSpeed += Gravity;
Y -= FallSpeed;
CanJump = false;
}
if (dbSpaceKey() && CanJump == true)
{
vSpeed = 3.0;
CanJump = false;
}
if ((Y - lastY) > 0)
vSpeed = Y - lastY;
if (vSpeed > 45)
vSpeed = 45;
if (vSpeed != 0)
Y += vSpeed;
if (Y > 9500)
{
Y = 9500;
vSpeed = 0;
}
if (Y < TerrainHeight)
Y = TerrainHeight;
lastY = Y;
dbPositionCamera(dbCameraPositionX(),Y + 10,dbCameraPositionZ());
dbUpdateTerrain ( );
dbSync ( );
}
}
And yes, this IS just the Terrain tutorial that has been minorly edited to add some cheap form of physics. The physics work though, so no complaints about that.
What does the variable 'c' represent in the equation 'E = MC^2'? Get it right, and I'll give you a cyber cookie.