Archived

This topic is now archived and is closed to further replies.

glPerfect

Need help

Recommended Posts

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

Share this post


Link to post
Share on other sites
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 ?

Share this post


Link to post
Share on other sites
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;

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites