fixed bug when using display lists
[mesa.git] / progs / demos / multiarb.c
index 267fbe95e30b57ef378bea2c45263f54fe42711d..6650f28c3e9fe0e2cb13ae9ed2d1f7a34cae0803 100644 (file)
@@ -1,12 +1,26 @@
-/* $Id: multiarb.c,v 1.2 1999/10/13 12:02:13 brianp Exp $ */
+/* $Id: multiarb.c,v 1.5 2000/02/02 17:31:45 brianp Exp $ */
 
 /*
  * GL_ARB_multitexture demo
+ *
+ * Command line options:
+ *    -info      print GL implementation information
+ *
+ *
  * Brian Paul  November 1998  This program is in the public domain.
  */
 
 /*
  * $Log: multiarb.c,v $
+ * Revision 1.5  2000/02/02 17:31:45  brianp
+ * changed > to >=
+ *
+ * Revision 1.4  2000/02/02 01:07:21  brianp
+ * limit Drift to [0, 1]
+ *
+ * Revision 1.3  1999/10/21 16:40:32  brianp
+ * added -info command line option
+ *
  * Revision 1.2  1999/10/13 12:02:13  brianp
  * use texture objects now
  *
@@ -53,6 +67,8 @@ static void Idle( void )
 {
    if (Animate) {
       Drift += 0.05;
+      if (Drift >= 1.0)
+         Drift = 0.0;
 
 #ifdef GL_ARB_multitexture
       glActiveTextureARB(GL_TEXTURE0_ARB);
@@ -224,7 +240,7 @@ static void SpecialKey( int key, int x, int y )
 }
 
 
-static void Init( void )
+static void Init( int argc, char *argv[] )
 {
    GLuint texObj[2];
 
@@ -289,6 +305,13 @@ static void Init( void )
    glClearColor(0.3, 0.3, 0.4, 1.0);
 
    ModeMenu(TEXBOTH);
+
+   if (argc > 1 && strcmp(argv[1], "-info")==0) {
+      printf("GL_RENDERER   = %s\n", (char *) glGetString(GL_RENDERER));
+      printf("GL_VERSION    = %s\n", (char *) glGetString(GL_VERSION));
+      printf("GL_VENDOR     = %s\n", (char *) glGetString(GL_VENDOR));
+      printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS));
+   }
 }
 
 
@@ -299,7 +322,7 @@ int main( int argc, char *argv[] )
    glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
    glutCreateWindow(argv[0] );
 
-   Init();
+   Init( argc, argv );
 
    glutReshapeFunc( Reshape );
    glutKeyboardFunc( Key );