Codeblocks can also attach a debugger. I attached the PID it gave me when I ran the debugger and nothing happened. I also put MessageBox() functions in different places, and it does run through rendering the images, but it hangs on the second object and doesn't finish rendering it. This is another spot that doesn't make sense to me, if it can render the first, why isn't it rendering the second or third or so on? Here's where I added the MessageBoxes. Also, I ran the function through a console window and had it print all the values it stores, and it is storing and adding the second, third, and so on objects correctly.
Code:
bool LOADOBJ::RenderAllObjects()
{
if(head.size() == 0) return false; //nothing to render
ObjectList *temp; //temp space for the render function
int f_index = 0, f_index2 = 0; //face index, and non-changing face index
/*render all objects to the screen*/
glPolygonMode( GL_BACK, GL_LINE ); // draw back face with lines
glPolygonMode( GL_FRONT, GL_LINE ); // draw front face with lines
for(int m = 0; m < head.size(); m++){
//MessageBox(NULL,"test","test",MB_OK); //FIRST MESSAGE BOX
temp = head.front(); //get the front object
head.pop(); //pop the front object
head.push(temp); //then put it back in line for the next time it's rendered
for(int i = 0; i < temp->face_count; i++){
//determine what type needs to be rendered
if(temp->vert_per_face[i] == 4)
glBegin(GL_QUADS); //render squares
else if(temp->vert_per_face[i] == 3)
glBegin(GL_TRIANGLES); //render triangles
else if(temp->vert_per_face[i] == 2)
glBegin(GL_LINES); //render lines
else if(temp->vert_per_face[i] == 1)
glBegin(GL_POINTS); //render points
else
glBegin(GL_POLYGON); //if nothing else render a polygon (5 or more vertex)
f_index2 = f_index;
for(int n = f_index2; n < f_index2 + temp->vert_per_face[i]; n++){
//create the 3D vertex
glVertex3f(temp->v_x[ temp->fv[n]-1 ], //x coordinate
temp->v_y[ temp->fv[n]-1 ], //y coordinate
temp->v_z[ temp->fv[n]-1 ]); //z coordinate
f_index++;
}
glEnd();
} //end for loop
//MessageBox(NULL,"test2","test2",MB_OK); //SECOND MESSAGE BOX
f_index2 = 0; f_index = 0;
}
return true;
}