diff options
author | Keith Whitwell <[email protected]> | 2001-05-11 15:47:02 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2001-05-11 15:47:02 +0000 |
commit | b8f9980999cb3619b3b60c089e6fa3b780a52292 (patch) | |
tree | 87a02e243e79674aecf1ec6c90119f32d76b1094 /progs/demos/isosurf.c | |
parent | 5759f53934d3f70dd3968fd747cf5bcb92563f21 (diff) |
fix a couple of small bugs
Diffstat (limited to 'progs/demos/isosurf.c')
-rw-r--r-- | progs/demos/isosurf.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/progs/demos/isosurf.c b/progs/demos/isosurf.c index 47e654f59a3..85fb7f215c7 100644 --- a/progs/demos/isosurf.c +++ b/progs/demos/isosurf.c @@ -1,4 +1,4 @@ -/* $Id: isosurf.c,v 1.10 2001/05/11 12:08:15 keithw Exp $ */ +/* $Id: isosurf.c,v 1.11 2001/05/11 15:47:02 keithw Exp $ */ /* * Display an isosurface of 3-D wind speed volume. @@ -84,6 +84,7 @@ static float compressed_data[MAXVERTS][6]; static float expanded_data[MAXVERTS*3][6]; static GLuint indices[MAXVERTS]; static GLuint tri_indices[MAXVERTS*3]; +static GLuint strip_indices[MAXVERTS]; static GLfloat col[100][4]; static GLint numverts, num_tri_verts, numuniq; @@ -352,6 +353,9 @@ static void make_tri_indices( void ) col[j][1] = myrand(1); col[j][0] = myrand(1); } + + for (i = 0; i < numverts ; i++) + strip_indices[i] = i; } #define MIN(x,y) (x < y) ? x : y @@ -431,7 +435,8 @@ static void draw_surface( int with_state ) glDrawArraysEXT( GL_TRIANGLE_STRIP, 0, numverts ); break; case (DRAW_ELTS|STRIPS): - glDrawElements( GL_TRIANGLE_STRIP, numverts, GL_UNSIGNED_INT, indices ); + glDrawElements( GL_TRIANGLE_STRIP, numverts, + GL_UNSIGNED_INT, strip_indices ); break; /* Uses the original arrays (including duplicate elements): @@ -796,8 +801,6 @@ static void Init(int argc, char *argv[]) glEnable( GL_VERTEX_ARRAY_EXT ); glEnable( GL_NORMAL_ARRAY_EXT ); - InitMaterials(); - glMatrixMode(GL_PROJECTION); glLoadIdentity(); glFrustum( -1.0, 1.0, -1.0, 1.0, 5, 25 ); @@ -806,6 +809,8 @@ static void Init(int argc, char *argv[]) glLoadIdentity(); glClipPlane(GL_CLIP_PLANE0, plane); + InitMaterials(); + set_matrix(); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); |