From b043205853b784a6faf1a718173893703013523f Mon Sep 17 00:00:00 2001 From: dcnieho Date: Sat, 17 Mar 2012 01:35:11 +0000 Subject: [PATCH] was still trying to draw RhombicDodecahedron as GL_QUAD, of course it doesn't work Made internal draw macro for case with edge flags git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1164 7f0cb862-5218-0410-a997-914c9d46530a --- freeglut/freeglut/src/fg_geometry.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/freeglut/freeglut/src/fg_geometry.c b/freeglut/freeglut/src/fg_geometry.c index 837b4fb..f0ab8d9 100644 --- a/freeglut/freeglut/src/fg_geometry.c +++ b/freeglut/freeglut/src/fg_geometry.c @@ -591,8 +591,8 @@ static void fghCircleTable(double **sint,double **cost,const int n) } -/* -- INTERNAL DRAWING functions to avoid code duplication ------------- */ -#define DECLARE_INTERNAL_DRAW(vertexMode,name,nameICaps,nameCaps)\ +/* -- INTERNAL DRAWING functions --------------------------------------- */ +#define _DECLARE_INTERNAL_DRAW_DO_DECLARE(name,nameICaps,nameCaps,edgeFlags)\ static void fgh##nameICaps( GLboolean useWireMode )\ {\ if (!name##Cached)\ @@ -600,8 +600,10 @@ static void fghCircleTable(double **sint,double **cost,const int n) fgh##nameICaps##Generate();\ name##Cached = GL_TRUE;\ }\ - fghDrawGeometry(vertexMode,name##_verts,name##_norms,NULL,nameCaps##_VERT_PER_OBJ_TRI,useWireMode);\ + fghDrawGeometry(GL_TRIANGLES,name##_verts,name##_norms,edgeFlags,nameCaps##_VERT_PER_OBJ_TRI,useWireMode);\ } +#define DECLARE_INTERNAL_DRAW(name,nameICaps,nameCaps) _DECLARE_INTERNAL_DRAW_DO_DECLARE(name,nameICaps,nameCaps,NULL) +#define DECLARE_INTERNAL_DRAW_DECOMPOSED_TO_TRIANGLE(name,nameICaps,nameCaps) _DECLARE_INTERNAL_DRAW_DO_DECLARE(name,nameICaps,nameCaps,name##_edgeFlags) static void fghCube( GLdouble dSize, GLboolean useWireMode ) { @@ -626,10 +628,10 @@ static void fghCube( GLdouble dSize, GLboolean useWireMode ) fghDrawGeometry(GL_TRIANGLES,cube_verts,cube_norms,cube_edgeFlags,CUBE_VERT_PER_OBJ_TRI,useWireMode); } -DECLARE_INTERNAL_DRAW(GL_TRIANGLES,icosahedron,Icosahedron,ICOSAHEDRON); -DECLARE_INTERNAL_DRAW(GL_TRIANGLES,octahedron,Octahedron,OCTAHEDRON); -DECLARE_INTERNAL_DRAW(GL_QUADS,rhombicdodecahedron,RhombicDodecahedron,RHOMBICDODECAHEDRON); -DECLARE_INTERNAL_DRAW(GL_TRIANGLES,tetrahedron,Tetrahedron,TETRAHEDRON); +DECLARE_INTERNAL_DRAW(icosahedron,Icosahedron,ICOSAHEDRON); +DECLARE_INTERNAL_DRAW(octahedron,Octahedron,OCTAHEDRON); +DECLARE_INTERNAL_DRAW_DECOMPOSED_TO_TRIANGLE(rhombicdodecahedron,RhombicDodecahedron,RHOMBICDODECAHEDRON); +DECLARE_INTERNAL_DRAW(tetrahedron,Tetrahedron,TETRAHEDRON); static void fghSierpinskiSponge ( int numLevels, GLdouble offset[3], GLdouble scale, GLboolean useWireMode ) {