Skip to main content
GameDev.net gamedev.net
🔒 Locked

Need help

Started by glPerfect Dec 11, 2001 at 1:54 PM 4 replies 300+ views
Original Post
glPerfect
glPerfect
Hi everybody. I have an big problem with the Vertex-storage. I''m not able to load much vertex-arrys. I put the source on http://www.bozkurtwebspace.com.kg/noname/ can somebody help me? mail at: Markus_Reitmeier@Hotmail.com thx
Fruny
Fruny
Your code is running fine here, except that using globals to store class data is bad : all your MESH objects seem to share the same OBJECT*. And GetObjectIndex() may not return a value.

What problems do you run into, exactly ?
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
glPerfect
glPerfect
I get an error message:
Unhandled exception in Raven.exe 0xC0000005: Access Violation.

at the debug window:
First-chance exception in Raven.exe: 0xC0000005: Access Violation.

the error is at the AddVertex routine, but only when the 4. Vertex is adding to the other.

sObject[nCurObject].vVertex[nCurVertex].z = z;

mkaltner
mkaltner
That''s a memory allocation issue.
That means either

sObject[nCurObject]

or

vVertex[nCurVertex]

does not exist and you''re trying to put something where something doesn''t exists. So you get that error.

Double check your array initialization and make sure that nCurObject and nCurVertex are not greater than the size of the array...

- Mike
"The important thing to remember when programming is: When you're 90% complete, there's still 50% more to go."
glPerfect
glPerfect
The sObject and vVertex is correctly initialized.

the nCurObject value is 0
the nCurVertex value is 3

that all is correct.

The first 3 runs are ok. After the 3rd one the following error appears.

CXX0030: Error: expression cannot be evaluated
Fruny
Fruny
Still works without a hitch here (VC++ Pro 6.0, Service Pack 5, Processor Pack) both in debug and release.

The step by step in AddVertex passes through nCurObject == 0, nCurVertex == 3 without problem.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.