View Full Version : HeightMap demo keeps crashing :(
I'm proficient at Pascal but new to C / C++ so I thought I'd make a simple terrain engine to teach myself. I downloaded this tutorial ( http://www.gametutorials.com/download/OpenGL/HeightMap_OGL.zip ) and it looks great. However it keeps crashing consistently if I go left past a certain point or backwards past a certain point. I'm guessing this is caused by the value of a "positive only" variable getting decremented to a point where it goes below zero. I peeked at the source code but almost all the variables are floating point type. I'll pore over the code tomorrow in detail when I'm less tired ( right now my head is swimming just looking at it hehe )
Any pointers ( pardon the pun ) would be appreciated.
09-06-2002, 06:40 PM
hmmm...i ran it and backed up so much, the geometry went past the far clipping plane, but it did not crash. did you get that far? i haven't looked at the code. did you recompile it and run it?
[This message has been edited by coredump (edited 09-06-2002).]
no i just ran the precompiled binary. Maybe its something in my setup or a combination of things. Im running a voodoo 5 5500 AGP under Win ME.
man i feel so dumb in my haste, I posted the wrong link above the buggy example is http://www.gametutorials.com/download/OpenGL/HeightMap2_OGL.zip
i got a friend to download it and he gets the same error. Someone suggested changing the floats to long floats. I'll try that.
09-08-2002, 12:23 PM
I doubt changing floats to "long floats" (otherwise known as doubles in C/C++) is going to fix a crashing error. Also setting an unsigned to a negative value doesn't cause a crash, it will simply set the value to the appropriate two's complement value.
Crashes in C/C++ are almost always caused by touching memory that shouldn't be touched. Some examples of this would be going outside the bounds of an array or accessing a dangling pointer.
09-08-2002, 01:23 PM
I never noticed the problem before when I've run this but tried it again and moved back for ages. Eventually I got the error... trying in IDE for debugging... no error occured this time... the last time that happened to me was due to a memory problem with an array not correctly set up.
After some debugging the problem only seems to occur for me if I try to go beyond the skybox setup. Should be rectifiable by setting a test up to stop movement outside of the skybox.
Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.