/* $Id: trispd.c,v 1.2 2000/10/26 15:26:14 brianp Exp $ */ /* * Simple GLUT program to measure triangle strip rendering speed. * Brian Paul February 15, 1997 This file is in the public domain. */ /* * $Log: trispd.c,v $ * Revision 1.2 2000/10/26 15:26:14 brianp * added a glFinish() call * * Revision 1.1.1.1 1999/08/19 00:55:40 jtg * Imported sources * * Revision 3.4 1999/03/28 18:24:37 brianp * minor clean-up * * Revision 3.3 1999/03/18 08:16:52 joukj * * cmpstr needs string.h to included to avoid warnings * * Revision 3.2 1998/07/08 03:02:00 brianp * added Marten Stromberg's texture options * * Revision 3.1 1998/06/29 02:36:58 brianp * removed unneeded includes * * Revision 3.0 1998/02/14 18:42:29 brianp * initial rev * */ #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