llvmpipe: still more bin code reorganization
[mesa.git] / progs / demos / stex3d.c
index b7ba1e9b0f3fc6c891a51dbc98f36a6e7216cd30..c0bbea0960f4933589924c75b7142f42124bedb1 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id: stex3d.c,v 1.9 2003/03/31 16:51:38 brianp Exp $ */
-
 /*----------------------------- 
  * stex3d.c GL example of the mesa 3d-texture extention to simulate procedural
  *            texturing, it uses a perlin noise and turbulence functions.
@@ -20,7 +18,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <math.h>
-#include <GL/gl.h>
+#include <GL/glew.h>
 #include <GL/glut.h>
 
 
@@ -344,19 +342,19 @@ parseCmdLine(int argc, char **argv)
    GLint i;
 
    for (i = 1; i < argc; i++) {
-      if (strstr(argv[i], "-w") == 0) {
+      if (strcmp(argv[i], "-help") == 0) {
+        printHelp();
+        return GL_FALSE;
+      }
+      else if (strstr(argv[i], "-w") != NULL) {
         tex_width = atoi((argv[i]) + 2);
       }
-      else if (strstr(argv[i], "-h") == 0) {
+      else if (strstr(argv[i], "-h") != NULL) {
         tex_height = atoi((argv[i]) + 2);
       }
-      else if (strstr(argv[i], "-d") == 0) {
+      else if (strstr(argv[i], "-d") != NULL) {
         tex_depth = atoi((argv[i]) + 2);
       }
-      else if (strcmp(argv[i], "-help") == 0) {
-        printHelp();
-        return GL_FALSE;
-      }
       else {
         printf("%s (Bad option).\n", argv[i]);
         printHelp();
@@ -535,7 +533,7 @@ KeyHandler(unsigned char key, int x, int y)
 }
 
 
-void
+static void
 create3Dgradient(void)
 {
    unsigned char *v;
@@ -664,6 +662,8 @@ main(int argc, char **argv)
       exit(0);
    }
 
+   glewInit();
+
    init();
 
    printHelp();