glxgears says:
58538 frames in 5.0 seconds = 11707.478 FPS
Here is my drawing function:
void ModelFile::DrawTriangles(const bool Normals, const bool Named) const
{
bool HasColors = false;
if(NumColors() > 0)
HasColors = true;
else
glColor3ub(100, 100, 100);
if(Named)
glPushName(1);
if(NumTriangles() > 0)
{
//cout << "Drawing " << NumTriangles() << "Triangles with " << NumColors() << " colors." << endl;
for(int i = 0; i < NumTriangles(); i++)
{
if(Named)
glLoadName(i);
if(HasColors) //color!
{
geom_Color<unsigned char> cu = Colors_[i];
glColor3ub(cu.getR(), cu.getG(), cu.getB());
}
Triangles_[i].Draw(Normals);
}
}
else
{
DrawPoints();
}
}
I make the display list with :
int list;
list = glGenLists(1);
glNewList(list,GL_COMPILE);
Scene.DrawTriangles(true, true);
glEndList();
and then I call it like this
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
gluPerspective(50, 1, 1, 100); //field of view angle, aspect ratio, znear, zfar
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
//gluLookAt(2, 2, 10, 0, 0, 0, 0, 1, 0);
gluLookAt(Location_.getX(), Location_.getY(), Location_.getZ(), P.getX(), P.getY(), P.getZ(), 0, 1, 0);
//display(Model);
display(list);
The camera location is simply updated between calls.
Is there any reason this would be so slow?
Thanks,
Dave