added dither key option
authorBrian Paul <brian.paul@tungstengraphics.com>
Fri, 8 Sep 2000 21:45:21 +0000 (21:45 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Fri, 8 Sep 2000 21:45:21 +0000 (21:45 +0000)
progs/demos/drawpix.c

index 9f599890dbf8c9dcd79fbbd67f5d24c13a24ca36..f86b1386b2a2b3cc371e25e8d6a24b2ee5b388ea 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: drawpix.c,v 1.3 1999/10/28 18:23:29 brianp Exp $ */
+/* $Id: drawpix.c,v 1.4 2000/09/08 21:45:21 brianp Exp $ */
 
 /*
  * glDrawPixels demo/test/benchmark
@@ -8,6 +8,9 @@
 
 /*
  * $Log: drawpix.c,v $
+ * Revision 1.4  2000/09/08 21:45:21  brianp
+ * added dither key option
+ *
  * Revision 1.3  1999/10/28 18:23:29  brianp
  * minor changes to Usage() function
  *
@@ -51,7 +54,7 @@ static int DrawWidth, DrawHeight;
 static int Scissor = 0;
 static float Xzoom, Yzoom;
 static GLboolean DrawFront = GL_FALSE;
-
+static GLboolean Dither = GL_TRUE;
 
 
 static void Reset( void )
@@ -154,6 +157,13 @@ static void Key( unsigned char key, int x, int y )
       case ' ':
          Reset();
          break;
+      case 'd':
+         Dither = !Dither;
+         if (Dither)
+            glEnable(GL_DITHER);
+         else
+            glDisable(GL_DITHER);
+         break;
       case 'w':
          if (DrawWidth > 0)
             DrawWidth--;
@@ -318,7 +328,7 @@ int main( int argc, char *argv[] )
    if (ciMode)
       glutInitDisplayMode( GLUT_INDEX | GLUT_DOUBLE );
    else
-      glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
+      glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE);
 
    glutCreateWindow(argv[0]);