/* $Id: clearspd.c,v 1.2 2000/04/10 16:25:15 brianp Exp $ */ /* * Simple GLUT program to measure glClear() and glutSwapBuffers() speed. * Brian Paul February 15, 1997 This file in public domain. */ /* * $Log: clearspd.c,v $ * Revision 1.2 2000/04/10 16:25:15 brianp * fixed visual selection and reporting results * * Revision 1.1.1.1 1999/08/19 00:55:40 jtg * Imported sources * * Revision 3.3 1999/03/28 18:18:33 brianp * minor clean-up * * Revision 3.2 1999/03/18 08:16:34 joukj * * cmpstr needs string.h to included to avoid warnings * * Revision 3.1 1998/06/29 02:38:30 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 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