#define DEFAULTS "*delay: 10000 \n" \
"*showFPS: False \n" \
"*fpsSolid: True \n" \
+ "*doubleBuffer: False \n" \
+ "*suppressRotationAnimation: True\n" \
# define refresh_noof 0
# define release_noof 0
#define N_SHAPES 7
+static int dbuf_p = 1; /* always */
+
ENTRYPOINT ModeSpecOpt noof_opts = {0, NULL, 0, NULL, NULL};
typedef struct {
0.22824, 0.21256, 0.19891, 0.18693, 0.17633, 0.16687,
};
-static void
+static int
drawleaf(noof_configuration *bp, int l)
{
-
+ int polys = 0;
int b, blades;
float x, y;
float wobble;
initshapes(bp, l); /* let it become reborn as something
else */
bp->tko++;
- return;
+ return polys;
} {
float w1 = sin(bp->geep[l] * 15.3 * M_PI / 180.0);
wobble = 3.0 + 2.00 * sin(bp->geep[l] * 0.4 * M_PI / 180.0) + 3.94261 * w1;
glVertex2f(x, y);
glVertex2f(x, -y); /* C */
glVertex2f(0.3, 0.0); /* D */
+ polys += 2;
glEnd();
/**
glVertex2f(x, y);
glVertex2f(0.3, 0.0); /* D */
glVertex2f(x, -y); /* C */
+ polys += 3;
glEnd();
glDisable(GL_BLEND);
glPopMatrix();
}
+ return polys;
}
static void
if (!bp->glx_context)
return;
glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(bp->glx_context));
+ mi->polygon_count = 0;
/**
if((random() & 0xff) == 0x34){
for (i = 0; i < N_SHAPES; i++) {
motionUpdate(bp, i);
colorUpdate(bp, i);
- drawleaf(bp, i);
+ mi->polygon_count += drawleaf(bp, i);
}
if (mi->fps_p) do_fps (mi);
glFinish();
-/* For some reason this hack screws up on Cocoa if we try to double-buffer it.
- It looks fine single-buffered, so let's just do that. */
-/* glXSwapBuffers(MI_DISPLAY(mi), MI_WINDOW(mi)); */
+ if (dbuf_p)
+ glXSwapBuffers(MI_DISPLAY(mi), MI_WINDOW(mi));
}
bp->glx_context = init_GL(mi);
- glDrawBuffer(GL_FRONT);
- glClearColor(0.0, 0.0, 0.0, 1.0);
+ glDrawBuffer(dbuf_p ? GL_BACK : GL_FRONT);
glEnable(GL_LINE_SMOOTH);
glShadeModel(GL_FLAT);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);