"*count: 25 \n" \
"*cycles: 40 \n" \
"*showFPS: False \n" \
- "*wireframe: False \n"
+ "*wireframe: False \n" \
+ "*suppressRotationAnimation: True\n" \
+
# define superquadrics_handle_event 0
# include "xlockmore.h" /* from the xscreensaver distribution */
#else /* !STANDALONE */
}
-static void
+static int
DoneScale(superquadricsstruct * sp)
{
double xx, yy, zz, xp = 0, yp = 0, zp = 0, xn, yn, zn, xnp = 0,
ynp = 0, znp = 0;
int ih, iv;
+ int polys = 0;
/* Hey don't knock my 2-letter variable names. Simon's BASIC rules, man! ;-> */
/* Just kidding..... */
if (ih > 1) {
glVertex3f(xx, yy, zz);
glVertex3f(sp->Prevxx[iv], sp->Prevyy[iv], sp->Prevzz[iv]);
+ polys++;
}
if (iv > 1) {
glVertex3f(xx, yy, zz);
glVertex3f(sp->Prevxx[iv - 1], sp->Prevyy[iv - 1], sp->Prevzz[iv - 1]);
+ polys++;
}
/* PURIFY 4.0.1 reports an unitialized memory read on the next line when using
* MesaGL 2.2 and -mono. This has been fixed in MesaGL 2.3 and later. */
if (!sp->flatshade)
glNormal3f(sp->Prevxn[iv - 1], sp->Prevyn[iv - 1], sp->Prevzn[iv - 1]);
glVertex3f(sp->Prevxx[iv - 1], sp->Prevyy[iv - 1], sp->Prevzz[iv - 1]);
+ polys++;
glEnd();
}
if (sp->shownorms) {
glBegin(GL_LINES);
glVertex3f(xx, yy, zz);
glVertex3f(xx + xn, yy + yn, zz + zn);
+ polys++;
glEnd();
if (!sp->flatshade)
glShadeModel(GL_SMOOTH);
} /* next */
} /* next */
+ return polys;
}
/**** End of really old code ****/
}
}
-static void
-DisplaySuperquadrics(superquadricsstruct * sp)
+static int
+DisplaySuperquadrics(ModeInfo *mi)
{
+ superquadricsstruct *sp = &superquadrics[MI_SCREEN(mi)];
+ int polys = 0;
glDrawBuffer(GL_BACK);
if (sp->wireframe)
glClear(GL_COLOR_BUFFER_BIT);
SetCull(0, sp);
- DoneScale(sp);
+ glScalef(0.7, 0.7, 0.7); /* jwz: scale it down a bit */
+
+# ifdef HAVE_MOBILE /* Keep it the same relative size when rotated. */
+ {
+ GLfloat h = MI_HEIGHT(mi) / (GLfloat) MI_WIDTH(mi);
+ int o = (int) current_device_rotation();
+ if (o != 0 && o != 180 && o != -180)
+ glScalef (1/h, 1/h, 1/h);
+ }
+# endif
+
+ polys = DoneScale(sp);
glPopMatrix();
/* Remember to flush & swap the buffers after calling this function! */
+ return polys;
}
-static void
-NextSuperquadricDisplay(superquadricsstruct * sp)
+static int
+NextSuperquadricDisplay(ModeInfo *mi)
{
+ superquadricsstruct *sp = &superquadrics[MI_SCREEN(mi)];
NextSuperquadric(sp);
- DisplaySuperquadrics(sp);
+ return DisplaySuperquadrics(mi);
}
#define MINSIZE 200
if (snorm)
sp->shownorms = 1;
- glClearColor(0.0,0.0,0.0,1.0);
glClearDepth(1.0);
if (sp->wireframe) {
MI_COUNT(mi), MI_CYCLES(mi), spinspeed, sp);
ReshapeSuperquadrics(MI_WIDTH(mi), MI_HEIGHT(mi));
- DisplaySuperquadrics(sp);
+ DisplaySuperquadrics(mi);
glFinish();
glXSwapBuffers(display, window);
} else {
glXMakeCurrent(display, window, *(sp->glx_context));
- NextSuperquadricDisplay(sp);
+ mi->polygon_count = NextSuperquadricDisplay(mi);
if (mi->fps_p) do_fps (mi);
glFinish();