X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fsphere.c;h=10e86d7698e1fd6b81229034067a9f5ae39deb73;hp=9288b2f92c4287628e18dbeaec8f9159a8e0cc2e;hb=de460e831dc8578acfa8b72251ab9346c99c1f96;hpb=6b1c86cf395f59389e4ece4ea8f4bea2c332745b diff --git a/hacks/glx/sphere.c b/hacks/glx/sphere.c index 9288b2f9..10e86d76 100644 --- a/hacks/glx/sphere.c +++ b/hacks/glx/sphere.c @@ -1,4 +1,4 @@ -/* sphere, Copyright (c) 2002 Paul Bourke +/* sphere, Copyright (c) 2002, 2008 Paul Bourke * Utility function to create a unit sphere in GL. * * Permission to use, copy, modify, distribute, and sell this software and its @@ -32,9 +32,10 @@ typedef struct { GLfloat x, y, z; } XYZ; -void +int unit_sphere (int stacks, int slices, int wire_p) { + int polys = 0; int i,j; double theta1, theta2, theta3; XYZ e, p; @@ -53,7 +54,7 @@ unit_sphere (int stacks, int slices, int wire_p) glBegin (GL_POINTS); glVertex3f (c.x, c.y, c.z); glEnd(); - return; + return 1; } glFrontFace(GL_CW); @@ -99,7 +100,9 @@ unit_sphere (int stacks, int slices, int wire_p) 2*j / (double)stacks2); glVertex3f (p.x, p.y, p.z); if (wire_p) lb = p; + polys++; } glEnd(); } + return polys; }