From b171a73282090d1b5e3886055bcd0ba9e996e5c9 Mon Sep 17 00:00:00 2001 From: dcnieho Date: Sun, 18 Mar 2012 07:37:08 +0000 Subject: [PATCH] per old glut manpages, glutTeapot calls generate clockwise frontfacing polygons. Following recommendations in these manpages, updated the shapes demo by surrounding calls with glFrontFace(GL_CW); and glFrontFace(GL_CCW); git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1190 7f0cb862-5218-0410-a997-914c9d46530a --- freeglut/freeglut/progs/demos/shapes/shapes.c | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/freeglut/freeglut/progs/demos/shapes/shapes.c b/freeglut/freeglut/progs/demos/shapes/shapes.c index ac0a48c..3b1e98e 100644 --- a/freeglut/freeglut/progs/demos/shapes/shapes.c +++ b/freeglut/freeglut/progs/demos/shapes/shapes.c @@ -87,8 +87,6 @@ static void drawSolidIcosahedron(void) { glutSolidIcosahedron (); static void drawWireIcosahedron(void) { glutWireIcosahedron (); } static void drawSolidSierpinskiSponge(void) { glutSolidSierpinskiSponge (depth, offset, orad);} /* orad doubles as size input */ static void drawWireSierpinskiSponge(void) { glutWireSierpinskiSponge (depth, offset, orad); } /* orad doubles as size input */ -static void drawSolidTeapot(void) { glutSolidTeapot(orad); } /* orad doubles as size input */ -static void drawWireTeapot(void) { glutWireTeapot(orad); } /* orad doubles as size input */ static void drawSolidTorus(void) { glutSolidTorus(irad,orad,slices,stacks); } static void drawWireTorus(void) { glutWireTorus (irad,orad,slices,stacks); } static void drawSolidSphere(void) { glutSolidSphere(orad,slices,stacks); } /* orad doubles as size input */ @@ -97,6 +95,24 @@ static void drawSolidCone(void) { glutSolidCone(orad,orad,slices, static void drawWireCone(void) { glutWireCone(orad,orad,slices,stacks); } /* orad doubles as size input */ static void drawSolidCylinder(void) { glutSolidCylinder(orad,orad,slices,stacks); } /* orad doubles as size input */ static void drawWireCylinder(void) { glutWireCylinder(orad,orad,slices,stacks); } /* orad doubles as size input */ +static void drawSolidTeapot(void) +{ + /* per Glut manpage, it should be noted that the teapot is rendered + * with clockwise winding for front facing polygons... + */ + glFrontFace(GL_CW); + glutSolidTeapot(orad); /* orad doubles as size input */ + glFrontFace(GL_CCW); +} +static void drawWireTeapot(void) +{ + /* per Glut manpage, it should be noted that the teapot is rendered + * with clockwise winding for front facing polygons... + */ + glFrontFace(GL_CW); + glutWireTeapot(orad); /* orad doubles as size input */ + glFrontFace(GL_CCW); +} #define RADIUS 1.0f