was still trying to draw RhombicDodecahedron as GL_QUAD, of course it
authorDiederick Niehorster <dcnieho@gmail.com>
Sat, 17 Mar 2012 01:35:11 +0000 (01:35 +0000)
committerDiederick Niehorster <dcnieho@gmail.com>
Sat, 17 Mar 2012 01:35:11 +0000 (01:35 +0000)
doesn't work
Made internal draw macro for case with edge flags

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1164 7f0cb862-5218-0410-a997-914c9d46530a

src/fg_geometry.c

index 837b4fb..f0ab8d9 100644 (file)
@@ -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 )
 {