Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

PureGDK / Dark GDK dbBuildTerrain keeps crashing, causing pain in head.

Author
Message
Mobilemedved
2
Years of Service
User Offline
Joined: 23rd Jan 2015
Location:
Posted: 18th May 2015 18:15
TerrainID=134


int __stdcall WinMain(HINSTANCE, HINSTANCE, LPSTR, int) {
HWND hWnd;
if (!initDarkGDK("gdkengine.dll"))
return 1;

int screenW = GetSystemMetrics(SM_CXSCREEN);
int screenH = GetSystemMetrics(SM_CYSCREEN);

hWnd = openWindow(0, 0, screenW, screenH, "симулятор АНСАТ. нулевое демо",
WS_OVERLAPPED | WS_CLIPSIBLINGS | WS_CAPTION | WS_SYSMENU |
WS_CLIPCHILDREN, true);

dbOpenScreen(hWnd, 0, 0, screenW, screenH);
ShowWindow(hWnd, SW_SHOW);
dbSyncRate(60);
dbAutoCamOff();
........
........
.......

dbCreateAdvancedTerrain (TerrainID);
dbSetTerrainHeightMap ( TerrainID, "Resource/Terrain/tropical_HX.bmp");
dbSetTerrainScale ( TerrainID, 50, 10, 50);
dbSetTerrainSplit ( TerrainID, 8);
dbSetTerrainTexture ( TerrainID, TERRA_COLOR_TEXTURE, TERRA_DEATIL_LOW );
dbSetTerrainTiling ( TerrainID, 16);
dbBuildTerrain ( TerrainID );
...........
...............
.............
}

dbBuildTerrain crash!

zzz!
Mobilemedved
2
Years of Service
User Offline
Joined: 23rd Jan 2015
Location:
Posted: 26th May 2015 11:38
Problem solved! Advanced Terrain height map must be 512x512 pixel max

zzz!
revenant chaos
Valued Member
10
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Robbinsdale, MN
Posted: 10th Jul 2015 03:47
You should be able to use a larger heightmap if you increase the value passed into dbSetTerrainSplit(). Advanced terrain uses that number to determine how many pieces to break the terrain into, and the largest any one piece may be is 64x64 (512/8 = 64).

Login to post a reply

Server time is: 2017-11-21 17:16:19
Your offset time is: 2017-11-21 17:16:19