X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fsphere.c;h=182d0084667359696ec672b4ecae56bef08fff88;hp=eb004b11814a14075f3603cf4fd07e38b3db52dc;hb=f8cf5ac7b2f53510f80a0eaf286a25298be17bfe;hpb=ec8d2b32b63649e6d32bdfb306eda062769af823 diff --git a/hacks/glx/sphere.c b/hacks/glx/sphere.c index eb004b11..182d0084 100644 --- a/hacks/glx/sphere.c +++ b/hacks/glx/sphere.c @@ -24,12 +24,14 @@ # include "config.h" #endif -#ifdef HAVE_COCOA -# include -#else +#ifndef HAVE_COCOA # include #endif +#ifdef HAVE_JWZGLES +# include "jwzgles.h" +#endif /* HAVE_JWZGLES */ + #include "sphere.h" typedef struct { GLfloat x, y, z; } XYZ; @@ -41,12 +43,12 @@ unit_sphere (int stacks, int slices, int wire_p) int i,j; double theta1, theta2, theta3; XYZ p, n; - XYZ la = { 0, 0, 0 }, lb = { 0, 0, 0 }; + XYZ la = { 0, -1, 0 }, lb = { 0, -1, 0 }; XYZ c = {0, 0, 0}; /* center */ double r = 1.0; /* radius */ int stacks2 = stacks * 2; - int mode = (wire_p ? GL_LINE_LOOP : GL_TRIANGLE_STRIP); + int mode = (wire_p ? GL_LINE_STRIP : GL_TRIANGLE_STRIP); int arraysize, out; struct { XYZ p; XYZ n; GLfloat s, t; } *array; @@ -61,7 +63,6 @@ unit_sphere (int stacks, int slices, int wire_p) if (! array) abort(); out = 0; - if (slices < 4 || stacks < 2 || r <= 0) { mode = GL_POINTS; @@ -78,7 +79,7 @@ unit_sphere (int stacks, int slices, int wire_p) { theta3 = i * (M_PI+M_PI) / slices; - if (wire_p && i != 0) + if (wire_p) { array[out++].p = lb; /* vertex */ array[out++].p = la; /* vertex */