From afb833d4e89c312460a4ab9ed6a7a8ca4ebbfe1c Mon Sep 17 00:00:00 2001 From: jtg Date: Thu, 19 Aug 1999 00:55:39 +0000 Subject: Initial revision --- progs/demos/trispd.c | 277 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 277 insertions(+) create mode 100644 progs/demos/trispd.c (limited to 'progs/demos/trispd.c') diff --git a/progs/demos/trispd.c b/progs/demos/trispd.c new file mode 100644 index 0000000000..a836c9d80f --- /dev/null +++ b/progs/demos/trispd.c @@ -0,0 +1,277 @@ +/* $Id: trispd.c,v 1.1 1999/08/19 00:55:40 jtg 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.1 1999/08/19 00:55:40 jtg + * Initial revision + * + * 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