X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fhypertorus.c;h=17f948f144a0d8a3cef3b56122b1402428cbad8b;hp=1669707d3eba7dcd9f5af649bc5ec750211b51ba;hb=c1b9b55ad8d59dc05ef55e316aebf5863e7dfa56;hpb=de460e831dc8578acfa8b72251ab9346c99c1f96 diff --git a/hacks/glx/hypertorus.c b/hacks/glx/hypertorus.c index 1669707d..17f948f1 100644 --- a/hacks/glx/hypertorus.c +++ b/hacks/glx/hypertorus.c @@ -521,9 +521,10 @@ static void color(double angle) will only work correctly if numu and numv are set to 64 or any higher power of 2. Similarly, the banded appearance will only work correctly if numu and numv are divisible by 4. */ -static void hypertorus(ModeInfo *mi, double umin, double umax, double vmin, +static int hypertorus(ModeInfo *mi, double umin, double umax, double vmin, double vmax, int numu, int numv) { + int polys = 0; static const GLfloat mat_diff_red[] = { 1.0, 0.0, 0.0, 1.0 }; static const GLfloat mat_diff_green[] = { 0.0, 1.0, 0.0, 1.0 }; static const GLfloat mat_diff_trans_red[] = { 1.0, 0.0, 0.0, 0.7 }; @@ -651,10 +652,13 @@ static void hypertorus(ModeInfo *mi, double umin, double umax, double vmin, n[2] /= t; glNormal3fv(n); glVertex3fv(p); + polys++; } } glEnd(); } + polys /= 2; + return polys; } @@ -793,7 +797,7 @@ static void display_hypertorus(ModeInfo *mi) glMatrixMode(GL_MODELVIEW); glLoadIdentity(); - hypertorus(mi,0.0,2.0*M_PI,0.0,2.0*M_PI,64,64); + mi->polygon_count = hypertorus(mi,0.0,2.0*M_PI,0.0,2.0*M_PI,64,64); }