-/* $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
/*
* $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
static int DrawWidth, DrawHeight;
static int Scissor = 0;
static float Xzoom, Yzoom;
+static GLboolean DrawFront = GL_FALSE;
glDisable(GL_SCISSOR_TEST);
- glutSwapBuffers();
+ if (!DrawFront)
+ glutSwapBuffers();
}
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);
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;
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");
}