diff options
author | Jakob Bornecrantz <[email protected]> | 2009-07-03 18:53:58 +0200 |
---|---|---|
committer | Jakob Bornecrantz <[email protected]> | 2009-07-03 18:53:58 +0200 |
commit | 862488075c5537b0613753b0d14c267527fc6199 (patch) | |
tree | fd4d51272c86fbc88c12e2d16649547f3ca7b8df /progs/demos/isosurf.c | |
parent | 060c7f2321f72503c14f9f3f7bb27d59d8a90224 (diff) | |
parent | 94e1117c9ba259665cd8e790369dcd4c789a2f93 (diff) |
Merge branch 'mesa_7_5_branch'
Conflicts:
src/mesa/main/dlist.c
src/mesa/vbo/vbo_save_api.c
Diffstat (limited to 'progs/demos/isosurf.c')
-rw-r--r-- | progs/demos/isosurf.c | 25 |
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: |