Here it is :
// load images for the terrain
dbLoadImage ( "media\\texture.jpg", 1 ); // diffuse texture
dbLoadImage ( "media\\detail.jpg", 2 ); // detail texture
// create the terrain
dbSetupTerrain ( ); // set up terrain library
dbMakeObjectTerrain ( 1 ); // make a new terrain
dbSetTerrainHeightMap ( 1, "media\\map.bmp" ); // set the terrain height map
dbSetTerrainScale ( 1, 3, 0.6f, 3 ); // set the scale
dbSetTerrainSplit ( 1, 16 ); // set the split value
dbSetTerrainTiling ( 1, 4 ); // set the detail tiling
dbSetTerrainLight ( 1, 1, -0.25f, 0, 1, 1, 0.78f, 0.5f ); // set the light
dbSetTerrainTexture ( 1, 1, 2 ); // set the textures
dbBuildTerrain ( 1 ); // build the terrain
// I changed my mind, this terrain is not appropriate for this level
dbDeleteObject(1);
// No wait I changed my mind again, I want it back
// create the terrain
//dbSetupTerrain ( ); // No need to set up terrain library again right?
dbMakeObjectTerrain ( 1 ); // make a new terrain (PROGRAM CRASHES HERE WITH ERROR 4)
dbSetTerrainHeightMap ( 1, "media\\map.bmp" ); // set the terrain height map
dbSetTerrainScale ( 1, 3, 0.6f, 3 ); // set the scale
dbSetTerrainSplit ( 1, 16 ); // set the split value
dbSetTerrainTiling ( 1, 4 ); // set the detail tiling
dbSetTerrainLight ( 1, 1, -0.25f, 0, 1, 1, 0.78f, 0.5f ); // set the light
dbSetTerrainTexture ( 1, 1, 2 ); // set the textures
dbBuildTerrain ( 1 ); // build the terrain
---
http://christianboutin.com