Fix up more stale references to gl(X)_API.xml which have moved.
[mesa.git] / progs / fp / fp-tri.c
index 6c15540d38d121fe946e6f8b80f4d194d59ba120..e45a799a00eb639d47c367616c7fd99538d1853d 100644 (file)
@@ -73,7 +73,7 @@ static void Init( void )
    GLuint Texture;
    GLint errno;
    GLuint prognum;
-   char buf[4096];
+   char buf[50000];
    GLuint sz;
    FILE *f;
 
@@ -89,7 +89,7 @@ static void Init( void )
    }
    fprintf(stderr, "%.*s\n", sz, buf);
 
-   if (!glutExtensionSupported("GL_ARB_fragment_program")) {
+   if (!GLEW_ARB_fragment_program) {
       printf("Error: GL_ARB_fragment_program not supported!\n");
       exit(1);
    }
@@ -176,7 +176,19 @@ static void Init( void )
    }
 
 
+   {
+      const float Ambient[4] = { 0.0, 1.0, 0.0, 0.0 };
+      const float Diffuse[4] = { 1.0, 0.0, 0.0, 0.0 };
+      const float Specular[4] = { 0.0, 0.0, 1.0, 0.0 };
+      const float Emission[4] = { 0.0, 0.0, 0.0, 1.0 };
+      glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, Ambient);
+      glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, Diffuse);
+      glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, Specular);
+      glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, Emission);
+   }
+
    glClearColor(.1, .3, .5, 0);
+   fclose(f);
 }
 
 static void Reshape(int width, int height)
@@ -197,7 +209,7 @@ static void Key(unsigned char key, int x, int y)
       case 27:
        exit(1);
       default:
-       return;
+       break;
     }
 
     glutPostRedisplay();