Ok so I got it to compile with the DarkGDK2 in-house commands for BlitzTerrain.
I'm not going to get your hopes up, it compiled but didn't work correctly.
Here's the code I used. I translated the demo to the DarkGDK2 commands.
#include <time.h>
#include "DarkGDK.h"
#include "TimerBasedMovement.h"
//#include <BlitzTerrain.h>
#include <DarkGDK\plugins\dgdk-blitzterrain.h>
#include <Windows.h>
int main()
{
startDarkGDK( NULL,
NULL,
"Test Game",
NULL );
//START
dbCreateObjectCube( 10 , 1000 );
//Create BlitzTerrain
//BT_Main BTMain;
//Load images
dbLoadImage("Media/heightmap.bmp",1);
dbLoadImage("Media/texture.jpg",2);
dbLoadImage("Media/detail.tga",3);
dbLoadImage("Media/environment.bmp",4);
//Create terrain
//BT_Terrain* Terrain = BTMain.MakeTerrain();
int32_t btMain = BT_CreateTerrain();
//Set images
//Terrain->SetHeightmap(1);
//Terrain->SetTexture(2);
//Terrain->SetDetail(3);
BT_SetTerrainHeightMap( btMain , 1 );
BT_SetTerrainTexture( btMain , 2 );
BT_SetTerrainDetail( btMain , 3 );
//Set some other values
//Terrain->SetScale(12.0f);
//Terrain->SetYScale(2.0f);
//Terrain->SetSplit(8);
//Terrain->SetDetailTile(3.0f);
BT_SetTerrainScale( btMain , 12.0f );
BT_SetTerrainYScale( btMain , 2.0f );
BT_SetTerrainSplit( btMain , 8 );
BT_SetTerrainDetailTile( btMain , 3.0f );
//LOD
//Terrain->SetLOD(3); //3 LOD Levels.
//Terrain->SetLODDistance(1,1000.0f); //LOD Distances start at one and go up to 1 less the LOD level count
//Terrain->SetLODDistance(2,2000.0f);
BT_SetTerrainLod( btMain , 3 );
BT_SetTerrainLODDistance( btMain , 1 , 1000.0f );
BT_SetTerrainLODDistance( btMain , 2 , 2000.0f );
//Smoothing
//Terrain->SetSmoothing(1);
BT_SetTerrainSmoothing( btMain , 1 );
//Environment mapping
//Terrain->SetEnvironment(4);
//int EM_Grass=Terrain->AddEnvironment(dbRGB(0,128,0));
//int EM_Rock=Terrain->AddEnvironment(dbRGB(192,192,192));
//int EM_Sand=Terrain->AddEnvironment(dbRGB(128,64,0));
BT_SetTerrainEnvironment( btMain , 4 );
int EM_Grass=BT_AddTerrainEnvironment( btMain , dbRGB(0,128,0) );
int EM_Rock=BT_AddTerrainEnvironment( btMain , dbRGB(192,192,192));
int EM_Sand=BT_AddTerrainEnvironment( btMain , dbRGB(128,64,0));
//Build Terrain
//Terrain->Build(1,true); //Build the terrain with ObjectID 1, Seccond parameter prevents us from needing a build loop
BT_BuildTerrain( btMain , 1 , true );
//Setup camera
dbSetCameraRange(10.0f,10000.0f);
dbHideMouse();
//Enable auto render
//BTMain.EnableAutoRender(true);
BT_EnableAutoRender( true );
//Loop
unsigned long StartTime=clock();
float ElapsedTime=0.0f;
float cx,GHeight;
while( (windowEvent() != WM_CLOSE) &&
(!GetAsyncKeyState(VK_ESCAPE)) )
{
//Camera movement
ElapsedTime=(clock()-StartTime)/3000.0f+ElapsedTime*0.7f;
StartTime=clock();
cx=dbCameraAngleX()+dbMouseMoveY()/4.0f;
if(cx>90.0f)
cx=90.0f;
if(cx<-90.0f)
cx=-90.0f;
dbRotateCamera(cx,dbCameraAngleY()+dbMouseMoveX()/4.0f,0.0f);
if(dbUpKey() || dbDownKey())
dbMoveCamera((dbUpKey()-dbDownKey())*1000.0f*ElapsedTime);
//if(dbLeftKey() || dbRightKey())
// dbMoveCameraLeft(0,(dbLeftKey()-dbRightKey())*1000.0f*ElapsedTime);
//GHeight=Terrain->GetGroundHeight(dbCameraPositionX(),dbCameraPositionZ());
GHeight=BT_GetGroundHeight( btMain , dbCameraPositionX() , dbCameraPositionZ() );
if(dbCameraPositionY()-40.0f<GHeight)
dbPositionCamera(dbCameraPositionX(),GHeight+40.0f,dbCameraPositionZ());
//Environment mapping
//int CurrentEnvironment=Terrain->GetPointEnvironment(dbCameraPositionX(),dbCameraPositionZ());
int CurrentEnvironment=BT_GetPointEnvironment( btMain , dbCameraPositionX() , dbCameraPositionZ() );
if(CurrentEnvironment==EM_Grass)
dbCenterText(dbScreenWidth()/2,dbScreenHeight()/2,"ON GRASS");
if(CurrentEnvironment==EM_Rock)
dbCenterText(dbScreenWidth()/2,dbScreenHeight()/2,"ON ROCK");
if(CurrentEnvironment==EM_Sand)
dbCenterText(dbScreenWidth()/2,dbScreenHeight()/2,"ON SAND");
//WireFrame
if(dbKeyState(59))
//dbSetObjectWireframe(Terrain->GetObjectID(),true);
dbSetObjectWireframe( 1 , true );
if(dbKeyState(60))
//dbSetObjectWireframe(Terrain->GetObjectID(),false);
dbSetObjectWireframe( 1 , false );
//FPS
dbText(10,10,dbToString<int>(dbScreenFPS()));
//Position mouse
dbPositionMouse(dbScreenWidth()/2,dbScreenHeight()/2);
//Update screen
dbSync();
}
//END
dbCloseScreen();
return 0;
}
/* Basic loop ->
int main()
{
startDarkGDK( 0,
0,
"Test Game",
0 );
//START
int32_t cube = dbCreateObjectCube( 10 );
dbPositionCamera( 0 , 25 , 25 );
dbPointCamera( 0 , 5 , 0 );
while( (windowEvent() != WM_CLOSE) &&
(!GetAsyncKeyState(VK_ESCAPE)) )
{
dbRotateObject( cube , dbWrapValue(dbObjectAngleX(cube)+1.0f * tbmf) ,
dbWrapValue(dbObjectAngleY(cube)+1.0f * tbmf) ,
dbWrapValue(dbObjectAngleZ(cube)+1.0f * tbmf) );
tbmf.update();
dbSync();
}
//END
dbCloseScreen();
return 0;
}
*/
All I see is my little cube I make at the beginning and a glitchy movement when I press the arrow keys.
Ventures of the worlds around us are limited only by our imagination.