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.

Dark GDK / Error 4 - Please assist

Author
Message
CrochaN
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 6th Aug 2008 01:58
Hello guys.

I'm new to this forum and a total n00b to programming..

Long story short, i've downloaded and installed C++ 9.0 Express Edition with Dark GDK and Direct X SDK. Been reading the Tutorials and that helped me get started. I've been working on my very first project and encountered a problem that I cannot solve on my own. Tried searching these forums and found only one thread with similar problem, alas it did not help me either..

I'm trying to load a 3D Terrain generated in the T.ED editor, using Highmap and Texture images. The terrain is generated and textured, but when I start to debug the project i get an error messege "ERROR 4" and that's it.. No details on the error. As I've figured it out, it has something to do with dbTerrainUpdate command.

If anyone could assist me in anyway possible, I'd be very gratefull.

Here is my n00bish code samples. It's 2 .cpp files. One is the main programm loop and another one is creating the terrain.

Main:



Terrain creation .cpp file:



Please keep in mind that this is my very first programm...

Go easy on me.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 7th Aug 2008 23:41
What you should do is step through the loading code using the debugger and see which line it is running when it raises this error.

FYI, here are the error messages:


I don't know if the numbering starts from 0 or 1 though so I can't tell you if it's because the ID is invalid or the terrain failed to be created.

Gervais
20
Years of Service
User Offline
Joined: 11th Mar 2004
Location: Canada
Posted: 8th Aug 2008 01:49
Terain can only be created one time

if you try to recreate a terain it give this error
they did not implement the delete terrain yet in DGK

i sugest the you move the "Game()" function out of the loop this is why you have the error it try to recreate the terrain each loop
CrochaN
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 8th Aug 2008 14:31
Ah, ofc.. How silly of me. I was eager to test the results and did not change the game mode to next one. It was constantly looping the creation of the terrain..

Now that it's fixed, everything is working perfectly !

Thank you very much guys, sorry to bother you.

Login to post a reply

Server time is: 2024-09-30 03:23:11
Your offset time is: 2024-09-30 03:23:11