PDA

View Full Version : Simple call list problem



avocados
07-24-2005, 09:12 AM
I can't figure out why one of two display lists is drawing slow. Whichever list is called second will draw at half the frame rate.

GLuint call_lists[10];
GLuint call_list = 0;

...

void renderScene(void) {
...
//if current_obj is 0 by default, then 1 will
//draw at half the frame rate and vice versa
glCallList(mesh_obj[current_obj]);
...
}

int main(int argc, char **argv)
{
...
mesh_obj[0] = glGenLists(1);
glNewList(mesh_obj[0], GL_COMPILE);
drawTerrain();
glEndList();

mesh_obj[1] = glGenLists(1);
glNewList(mesh_obj[1], GL_COMPILE);
drawTerrain();//same draw function for test
glEndList();
glutMainLoop();
...
return(0);
}

07-24-2005, 11:16 AM
Thought I'd mention indexed vertex arrays (VBOs) as an alternative for drawing terrains, or for pretty much everything for that matter...

avocados
07-25-2005, 05:07 PM
I just want to make it clear to any passers-by that only one display list is being drawn at a time. If you read my original post without looking at the code I might sound like an idiot. :D

Thanks Hlz, maybe I should use vertex arrays, it would probably make the program load faster on start up.

07-25-2005, 05:44 PM
Yeah, I think you'll dig VBO's. They're suprisingly easy to use, and they make quick work of terrains.