   Display List is really(!) slow
  Hi everyone,I know I must be doing something very wrong. I had been working in immediate mode until someone told me that I was using the slowest possible method.I've since switched to display lists, but they seem to be even slow than immediate mode. My guess is that I'm doing something wrong.Here's my code which generates the list:    glNewList(index, GL_COMPILE);    for (std::vector<FaceGroup*>::iterator i = face_group_0.begin(); i != face_group_0.end(); ++i) {   glPushMatrix();   glEnable( GL_TEXTURE_2D );   glBindTexture(GL_TEXTURE_2D, texture_manager->texture[0].texture);   glBegin(GL_QUADS);  glColor4ub(255, 255, 255, 128);  // Push sides  glTexCoord2i( 0, 0 );  glVertex3f((*i)->x_origin + 1.f, (*i)->y_origin + (*i)->height, (*i)->z_origin + (*i)->width);  glTexCoord2i( (*i)->width, 0 );  glVertex3f((*i)->x_origin + 1.f, (*i)->y_origin + (*i)->height, (*i)->z_origin);  glTexCoord2i( (*i)->width, (*i)->height );  glVertex3f((*i)->x_origin + 1.f, (*i)->y_origin, (*i)->z_origin); glTexCoord2i( 0, (*i)->height );glVertex3f((*i)->x_origin + 1.f, (*i)->y_origin, (*i)->z_origin + (*i)->width);    glEnd();   glDisable(GL_TEXTURE_2D);   glPopMatrix();    }    glEndList();And I call the list in a draw function:void FaceGroupManager::Draw(){    glCallList(index);}Any ideas on what I might be doing wrong? Thank you for the help.   
  So here's a better question: should I just be using vertex arrays instead?   ;  Yes, and VBOs. They are the fastest methods.   ;  Why are you enabling and disabling texturing, and pushing and popping the matrix, for every single polygon? Dear god that must be slow.   ;  Remove the glEnable(GL_TEXTURE)/glDisable(GL_TEXTURE) calls. This positively destroys performance.Avoid using many small textures (one texture per quad, oh dear). Splat them all into a texture atlas and change texture coordinates, this will improve performance by two orders of magnitude.Display lists aren't helping because you are state-change limited. You are changing state so often that the CPU is bogged down trying to track it all.Don't use integer texture coordinates, use floats. They are faster.Don't allow your texture coordinates to  go outside [0.0, 1.0] if you can. Older cards may have trouble with that and GL_REPEAT, to the point where they fall back to software rendering (my old Geforce 2 did that when going outside 16.0 or so).   ;Quote:Original post by FiddlerAvoid using many small textures (one texture per quad, oh dear). Splat them all into a texture atlas and change texture coordinates, this will improve performance by two orders of magnitude.Definitely an advice in general. In this particular case, though, his call to glBindTexture is not loop dependent, so he's "only" binding the same texture over and over again (not that it makes it any better, just easier to solve by doing it once). Everything but glColor4ub, glTexCoord2i and glVertex3f can be put outside the loop.   