summaryrefslogtreecommitdiffstats
path: root/progs/demos/isosurf.c
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2009-06-30 16:28:37 +0100
committerKeith Whitwell <[email protected]>2009-06-30 16:28:54 +0100
commit4147bb24d49a10498e00039fc1dc9aa5f1316777 (patch)
treeceb027c40f52dd7e0471a3534bac7cd270b6953b /progs/demos/isosurf.c
parent53f8dccd0c9ab0b55e24dd5d624bbaaf0c8c284b (diff)
parent6af783bea0e171582f86c8456ca521ac242abc39 (diff)
Merge branch 'mesa_7_5_branch' into dlist-statechange-shortcircuit
Need this to pick up fixes for per-vertex materials.
Diffstat (limited to 'progs/demos/isosurf.c')
-rw-r--r--progs/demos/isosurf.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/progs/demos/isosurf.c b/progs/demos/isosurf.c
index e280d8f507c..6923ca2bba8 100644
--- a/progs/demos/isosurf.c
+++ b/progs/demos/isosurf.c
@@ -514,12 +514,27 @@ static void draw_surface( unsigned int with_state )
break;
case (GLVERTEX|STRIPS):
- glBegin( GL_TRIANGLE_STRIP );
- for (i=0;i<numverts;i++) {
- glNormal3fv( &data[i][3] );
- glVertex3fv( &data[i][0] );
+ if (with_state & MATERIALS) {
+ glBegin( GL_TRIANGLE_STRIP );
+ for (i=0;i<numverts;i++) {
+ if (i % 600 == 0 && i != 0) {
+ unsigned j = i / 600;
+ glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, col[j]);
+ glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, col[j]);
+ }
+ glNormal3fv( &data[i][3] );
+ glVertex3fv( &data[i][0] );
+ }
+ glEnd();
+ }
+ else {
+ glBegin( GL_TRIANGLE_STRIP );
+ for (i=0;i<numverts;i++) {
+ glNormal3fv( &data[i][3] );
+ glVertex3fv( &data[i][0] );
+ }
+ glEnd();
}
- glEnd();
break;
default: