[SOURCE]
GLvoid BuildLists() // Make A BuildList
{
astr=glGenLists(2);
glNewList(astr,GL_COMPILE);
GLfloat x_m, y_m, z_m, u_m, v_m;
int numquads;
numquads = sector1.numquads;
for (int loop_m = 0; loop_m < numquads; loop_m++) // Read BuildList From File
{
glBegin(GL_QUADS);
glNormal3f ( 0.0f, 0.0f, 1.0f);
x_m = sector1.quad[loop_m].vertex[0].x;
y_m = sector1.quad[loop_m].vertex[0].y;
z_m = sector1.quad[loop_m].vertex[0].z;
u_m = sector1.quad[loop_m].vertex[0].u;
v_m = sector1.quad[loop_m].vertex[0].v;
glTexCoord2f(u_m, v_m);glVertex3f(x_m, y_m, z_m);
[/SOURCE]
Debugger Error
(This is a extremly simplified version of my last post) Im trying to read from a file into a display list and I'm gettign a runtime error. When I debug it points out this section of code:
[/source]
sector1.quad[loop_m].vertex[0] Error : Expression cannot be evaulated.
It point this out for all 5 times. Its also give an error on x_m, but no info as to why. Any insight as to why it cant be evaluated.
If you need all the code its in my first post which people understandable hated:
http://muer.njoerdba.com/paste/view.aspx?id=d09bcb82-32ad-4faa-8fda-b8f95d19212c
Thx, Matt
[Edited by - Hola on November 5, 2004 10:34:38 PM]
The Best Is Yet To Come
It has given you this error because the variable you are trying to access does not exist. You may have read in the number of quads of the sector incorrectly, or you may have forgotten to allocate any Quads at all, before calling this function. While debugging, when the error occurs, check the value of the variable named "loop_m". If its value is 0, then you haven't allocated any Quads. If its value is greater than 0, then you haven't allocated enough Quads. I hope that helps. Good luck.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement