From: Diederick Niehorster Date: Sun, 18 Nov 2012 15:49:27 +0000 (+0000) Subject: shapes demo: cuboctahedron is from the demo itself and not from FreeGLUT X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=commitdiff_plain;h=c040e52334ad09da2e0309da13c796e24fb152da;p=freeglut shapes demo: cuboctahedron is from the demo itself and not from FreeGLUT geometry. Hence not supported in shader drawing mode. Now skipping it git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1404 7f0cb862-5218-0410-a997-914c9d46530a --- diff --git a/progs/demos/shapes/shapes.c b/progs/demos/shapes/shapes.c index b2da232..2ae69ab 100644 --- a/progs/demos/shapes/shapes.c +++ b/progs/demos/shapes/shapes.c @@ -759,7 +759,12 @@ key(unsigned char key, int x, int y) case 'r': animateXRot=!animateXRot; break; case 'S': - case 's': useShader=!useShader; break; + case 's': + useShader=!useShader; + /* Cuboctahedron can't be shown when in shader mode, move to next */ + if (useShader && NUMBEROF (table)-1 == ( unsigned )function_index) + function_index = 0; + break; case 'N': case 'n': visNormals=!visNormals; break; @@ -792,6 +797,13 @@ static void special (int key, int x, int y) if (NUMBEROF (table) <= ( unsigned )function_index) function_index = 0; + + /* Cuboctahedron can't be shown when in shader mode, skip it */ + if (useShader && NUMBEROF (table)-1 == ( unsigned )function_index) + if (key==GLUT_KEY_PAGE_UP) + function_index = 0; + else + function_index -= 1; }