/* * Simple GLUT program to measure glClear() and glutSwapBuffers() speed. * Brian Paul February 15, 1997 This file in public domain. */ #include #include #include #include #include static float MinPeriod = 2.0; /* 2 seconds */ static int ColorMode = GLUT_RGB; static int Width = 400.0; static int Height = 400.0; static int Loops = 100; static float ClearColor = 0.0; static GLbitfield BufferMask = GL_COLOR_BUFFER_BIT; static GLboolean SwapFlag = GL_FALSE; static void Idle( void ) { glutPostRedisplay(); } static void Display( void ) { double t0, t1; double clearRate; double pixelRate; int i; glClearColor( ClearColor, ClearColor, ClearColor, 0.0 ); ClearColor += 0.1; if (ClearColor>1.0) ClearColor = 0.0; if (SwapFlag) { t0 = glutGet(GLUT_ELAPSED_TIME) * 0.001; for (i=0;i