git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1866
7f0cb862-5218-0410-a997-
914c9d46530a
static GLboolean animateXRot = GL_FALSE;
static GLboolean useShader = GL_FALSE;
static GLboolean visNormals = GL_FALSE;
static GLboolean animateXRot = GL_FALSE;
static GLboolean useShader = GL_FALSE;
static GLboolean visNormals = GL_FALSE;
/*
* Enum to tell drawSizeInfo what to draw for each object
/*
* Enum to tell drawSizeInfo what to draw for each object
shapesPrintf (row++, 1, "Perspective projection (p)");
else
shapesPrintf (row++, 1, "Orthographic projection (p)");
shapesPrintf (row++, 1, "Perspective projection (p)");
else
shapesPrintf (row++, 1, "Orthographic projection (p)");
shapesPrintf (row++, 1, "Using shader (s)");
shapesPrintf (row++, 1, "Using shader (s)");
shapesPrintf (row++, 1, "Using fixed function pipeline (s)");
shapesPrintf (row++, 1, "Using fixed function pipeline (s)");
+ if (flat)
+ shapesPrintf (row++, 1, "Flat shading (f)");
+ else
+ shapesPrintf (row++, 1, "Smooth shading (f)");
+ }
if (animateXRot)
shapesPrintf (row++, 1, "2D rotation (r)");
else
if (animateXRot)
shapesPrintf (row++, 1, "2D rotation (r)");
else
glutSetOption(GLUT_GEOMETRY_VISUALIZE_NORMALS,visNormals); /* Normals visualized or not? */
glutSetOption(GLUT_GEOMETRY_VISUALIZE_NORMALS,visNormals); /* Normals visualized or not? */
+ glShadeModel(flat ? GL_FLAT : GL_SMOOTH); /* flat or gouraud shading */
+
if (useShader && !shaderReady)
initShader();
if (useShader && !shaderReady)
initShader();
function_index = 0;
break;
function_index = 0;
break;
+ case 'F':
+ case 'f':
+ flat ^= 1;
+ break;
+
case 'N':
case 'n': visNormals=!visNormals; break;
case 'N':
case 'n': visNormals=!visNormals; break;