Merge branch 'master' of git+ssh://joukj@git.freedesktop.org/git/mesa/mesa
[mesa.git] / progs / demos / isosurf.c
index 160886f9ce9694827999f1e43edcae4ec8a5b9bd..10f94b6ace236081c914ca8ca825490a190bdb3a 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id: isosurf.c,v 1.14 2002/01/04 09:47:17 gareth Exp $ */
 
 /*
  * Display an isosurface of 3-D wind speed volume.
 #include <math.h>
 #ifdef _WIN32
 #include <windows.h>
+#undef CLIP_MASK
 #endif
-#define GL_GLEXT_LEGACY
+#define GL_GLEXT_PROTOTYPES
 #include "GL/glut.h"
 
-#include "readtex.c"   /* I know, this is a hack.  KW: me too. */
+#include "readtex.h"
 #define TEXTURE_FILE "../images/reflect.rgb"
 
 #define LIT            0x00000001
@@ -84,7 +84,7 @@
 #define POLYGON_MASK           (POLYGON_FILL|POLYGON_LINE)
 
 #define MAXVERTS 10000
-static GLuint maxverts = MAXVERTS;
+static GLint maxverts = MAXVERTS;
 static float data[MAXVERTS][6];
 static float compressed_data[MAXVERTS][6];
 static float expanded_data[MAXVERTS*3][6];
@@ -337,7 +337,7 @@ static void make_tri_indices( void )
 {
    unsigned int *v = tri_indices;
    unsigned int parity = 0;
-   unsigned int i, j;
+   int i, j;
 
    for (j=2;j<numverts;j++,parity^=1) {
       if (parity) {
@@ -367,9 +367,9 @@ static void make_tri_indices( void )
 
 #define MIN(x,y) (x < y) ? x : y
 
-static void draw_surface( int with_state )
+static void draw_surface( unsigned int with_state )
 {
-   GLuint i, j;
+   GLint i, j;
    
    if (with_state & DISPLAYLIST) {
       if ((with_state & (RENDER_STYLE_MASK|PRIMITIVE_MASK|MATERIAL_MASK)) != 
@@ -1042,6 +1042,7 @@ int main(int argc, char **argv)
 
    read_surface( "isosurf.dat" );
 
+   glutInit( &argc, argv);
    glutInitWindowPosition(0, 0);
    glutInitWindowSize(400, 400);