/* * Simple GLUT program to measure triangle strip rendering speed. * Brian Paul February 15, 1997 This file is in the public domain. */ #include #include #include #include #include static float MinPeriod = 2.0; /* 2 seconds */ static float Width = 400.0; static float Height = 400.0; static int Loops = 1; static int Size = 50; static int Texture = 0; static void Idle( void ) { glutPostRedisplay(); } static void Display( void ) { float x, y; float xStep; float yStep; double t0, t1; double triRate; double pixelRate; int triCount; int i; float red[3] = { 1.0, 0.0, 0.0 }; float blue[3] = { 0.0, 0.0, 1.0 }; xStep = yStep = sqrt( 2.0 * Size ); glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); triCount = 0; t0 = glutGet(GLUT_ELAPSED_TIME) * 0.001; if (Texture) { float uStep = xStep / Width; float vStep = yStep / Height; float u, v; for (i=0; i