X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Ftangram_shapes.c;h=916d0a88735ba517b4261dcd0e4c2d49e1e307a2;hb=488f2fa8fbdbc77e91a70da2962d73af49e6cace;hp=25dec5b21f5f3defd8b3ff8c09485988f0185adb;hpb=3f438031d610c7e15fd33876a879b97e290e05fb;p=xscreensaver diff --git a/hacks/glx/tangram_shapes.c b/hacks/glx/tangram_shapes.c index 25dec5b2..916d0a88 100644 --- a/hacks/glx/tangram_shapes.c +++ b/hacks/glx/tangram_shapes.c @@ -9,7 +9,13 @@ * implied warranty. */ -#include +#ifdef HAVE_COCOA +# include +#else +# include +#endif + +#include "tangram_shapes.h" #define small_scale ( 1 ) #define large_scale ( 2 ) @@ -32,45 +38,60 @@ static void tri_45_90(int wire) glNormal3f(0, 1, 0); glVertex3fv(vertices[0]); + glNormal3f(0, 1, 0); glVertex3fv(vertices[2]); + glNormal3f(0, 1, 0); glVertex3fv(vertices[1]); glNormal3f(0, -1, 0); glVertex3fv(vertices[3]); + glNormal3f(0, -1, 0); glVertex3fv(vertices[4]); + glNormal3f(0, -1, 0); glVertex3fv(vertices[5]); glEnd(); glBegin((wire) ? GL_LINE_LOOP : GL_QUADS); glNormal3f(1, 0, 1); glVertex3fv(vertices[2]); + glNormal3f(1, 0, 1); glVertex3fv(vertices[5]); + glNormal3f(1, 0, 1); glVertex3fv(vertices[4]); + glNormal3f(1, 0, 1); glVertex3fv(vertices[1]); glNormal3f(-1, 0, 0); glVertex3fv(vertices[0]); + glNormal3f(-1, 0, 0); glVertex3fv(vertices[1]); + glNormal3f(-1, 0, 0); glVertex3fv(vertices[4]); + glNormal3f(-1, 0, 0); glVertex3fv(vertices[3]); glNormal3f(0, 0, -1); - glVertex3fv(vertices[2]); - glVertex3fv(vertices[5]); - glVertex3fv(vertices[3]); glVertex3fv(vertices[0]); + glNormal3f(0, 0, -1); + glVertex3fv(vertices[3]); + glNormal3f(0, 0, -1); + glVertex3fv(vertices[5]); + glNormal3f(0, 0, -1); + glVertex3fv(vertices[2]); glEnd(); } +static void unit_cube(int wire) { glBegin((wire) ? GL_LINE_LOOP : GL_QUADS); - glNormal3f(0.0f, -1.0f, 0.0f); - glVertex3f(0.0f, -alpha, 0.0f); - glVertex3f(1.0f, -alpha, 0.0f); - glVertex3f(1.0f, -alpha, 1.0f); - glVertex3f(0.0f, -alpha, 1.0f); + + glNormal3f(0.0f, 1.0f, 0.0f); + glVertex3f(0.0f, alpha, 0.0f); + glVertex3f(0.0f, alpha, 1.0f); + glVertex3f(1.0f, alpha, 1.0f); + glVertex3f(1.0f, alpha, 0.0f); glNormal3f(0.0f, 0.0f, 1.0f); glVertex3f(0.0f, -alpha, 1.0f); @@ -96,14 +117,16 @@ void unit_cube(int wire) glVertex3f(0.0f, alpha, 1.0f); glVertex3f(0.0f, alpha, 0.0f); - glNormal3f(0.0f, 1.0f, 0.0f); - glVertex3f(0.0f, alpha, 0.0f); - glVertex3f(0.0f, alpha, 1.0f); - glVertex3f(1.0f, alpha, 1.0f); - glVertex3f(1.0f, alpha, 0.0f); + glNormal3f(0.0f, -1.0f, 0.0f); + glVertex3f(0.0f, -alpha, 0.0f); + glVertex3f(1.0f, -alpha, 0.0f); + glVertex3f(1.0f, -alpha, 1.0f); + glVertex3f(0.0f, -alpha, 1.0f); + glEnd(); } +static void unit_rhomboid(int wire) { glBegin((wire) ? GL_LINE_LOOP : GL_QUADS);