|
|
@@ -1,4 +1,4 @@ |
|
|
|
/* $Id: drawpix.c,v 1.1 1999/08/19 00:55:40 jtg Exp $ */ |
|
|
|
/* $Id: drawpix.c,v 1.2 1999/10/21 22:13:58 brianp Exp $ */ |
|
|
|
|
|
|
|
/* |
|
|
|
* glDrawPixels demo/test/benchmark |
|
|
@@ -8,8 +8,11 @@ |
|
|
|
|
|
|
|
/* |
|
|
|
* $Log: drawpix.c,v $ |
|
|
|
* Revision 1.1 1999/08/19 00:55:40 jtg |
|
|
|
* Initial revision |
|
|
|
* Revision 1.2 1999/10/21 22:13:58 brianp |
|
|
|
* added f key to toggle front/back drawing |
|
|
|
* |
|
|
|
* 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 |
|
|
@@ -44,6 +47,7 @@ static int SkipPixels, SkipRows; |
|
|
|
static int DrawWidth, DrawHeight; |
|
|
|
static int Scissor = 0; |
|
|
|
static float Xzoom, Yzoom; |
|
|
|
static GLboolean DrawFront = GL_FALSE; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -82,7 +86,8 @@ static void Display( void ) |
|
|
|
|
|
|
|
glDisable(GL_SCISSOR_TEST); |
|
|
|
|
|
|
|
glutSwapBuffers(); |
|
|
|
if (!DrawFront) |
|
|
|
glutSwapBuffers(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@@ -100,6 +105,11 @@ static void Benchmark( void ) |
|
|
|
if (Scissor) |
|
|
|
glEnable(GL_SCISSOR_TEST); |
|
|
|
|
|
|
|
if (DrawFront) |
|
|
|
glDrawBuffer(GL_FRONT); |
|
|
|
else |
|
|
|
glDrawBuffer(GL_BACK); |
|
|
|
|
|
|
|
/* Run timing test */ |
|
|
|
draws = 0; |
|
|
|
startTime = glutGet(GLUT_ELAPSED_TIME); |
|
|
@@ -187,6 +197,14 @@ static void Key( unsigned char key, int x, int y ) |
|
|
|
case 'b': |
|
|
|
Benchmark(); |
|
|
|
break; |
|
|
|
case 'f': |
|
|
|
DrawFront = !DrawFront; |
|
|
|
if (DrawFront) |
|
|
|
glDrawBuffer(GL_FRONT); |
|
|
|
else |
|
|
|
glDrawBuffer(GL_BACK); |
|
|
|
printf("glDrawBuffer(%s)\n", DrawFront ? "GL_FRONT" : "GL_BACK"); |
|
|
|
break; |
|
|
|
case 27: |
|
|
|
exit(0); |
|
|
|
break; |
|
|
@@ -270,6 +288,7 @@ static void Usage(void) |
|
|
|
printf(" r Decrease GL_UNPACK_SKIP_ROWS\n"); |
|
|
|
printf(" R Increase GL_UNPACK_SKIP_ROWS\n"); |
|
|
|
printf(" s Toggle GL_SCISSOR_TEST\n"); |
|
|
|
printf(" f Toggle front/back buffer drawing\n"); |
|
|
|
printf(" b Benchmark test\n"); |
|
|
|
printf(" ESC Exit\n"); |
|
|
|
} |