X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fpipes.c;h=104f880be23103df37780f661cb8f04a422a710b;hp=1f6088fa02ea334dac7b25dbc0e86436d5609759;hb=f8cf5ac7b2f53510f80a0eaf286a25298be17bfe;hpb=ec8d2b32b63649e6d32bdfb306eda062769af823 diff --git a/hacks/glx/pipes.c b/hacks/glx/pipes.c index 1f6088fa..104f880b 100644 --- a/hacks/glx/pipes.c +++ b/hacks/glx/pipes.c @@ -59,6 +59,19 @@ static const char sccsid[] = "@(#)pipes.c 4.07 97/11/24 xlockmore"; #ifdef USE_GL +#ifdef HAVE_COCOA +# include "jwxyz.h" +#else +# include +# include +# include +#endif + +#ifdef HAVE_JWZGLES +# include "jwzgles.h" +#endif /* HAVE_JWZGLES */ + +#include "sphere.h" #include "buildlwo.h" #include "teapot.h" @@ -216,14 +229,22 @@ MakeTube(ModeInfo *mi, int direction) } static void -mySphere(float radius) +mySphere(float radius, Bool wire) { +#if 0 GLUquadricObj *quadObj; quadObj = gluNewQuadric(); gluQuadricDrawStyle(quadObj, (GLenum) GLU_FILL); gluSphere(quadObj, radius, 16, 16); gluDeleteQuadric(quadObj); +#else + glPushMatrix(); + glScalef (radius, radius, radius); + glRotatef (90, 1, 0, 0); + unit_sphere (16, 16, wire); + glPopMatrix(); +#endif } static void @@ -667,6 +688,11 @@ init_pipes (ModeInfo * mi) } pp = &pipes[screen]; +#ifdef HAVE_JWZGLES + /* Single-buffering on iOS is so confusing! */ + dbuf_p = True; +#endif + pp->window = MI_WINDOW(mi); if ((pp->glx_context = init_GL(mi)) != NULL) { @@ -724,6 +750,7 @@ draw_pipes (ModeInfo * mi) Display *display = MI_DISPLAY(mi); Window window = MI_WINDOW(mi); + Bool wire = MI_IS_WIREFRAME(mi); int newdir; int OPX, OPY, OPZ; @@ -763,7 +790,7 @@ draw_pipes (ModeInfo * mi) if (pp->olddir == dirNone) { glPushMatrix(); glTranslatef((pp->PX - 16) / 3.0 * 4.0, (pp->PY - 12) / 3.0 * 4.0, (pp->PZ - 16) / 3.0 * 4.0); - mySphere(0.6); + mySphere(0.6, wire); glPopMatrix(); } /* Check for stop conditions */ @@ -771,7 +798,7 @@ draw_pipes (ModeInfo * mi) glPushMatrix(); glTranslatef((pp->PX - 16) / 3.0 * 4.0, (pp->PY - 12) / 3.0 * 4.0, (pp->PZ - 16) / 3.0 * 4.0); /* Finish the system with another sphere */ - mySphere(0.6); + mySphere(0.6, wire); glPopMatrix(); @@ -834,7 +861,7 @@ draw_pipes (ModeInfo * mi) switch (sysT) { case 1: glTranslatef((pp->PX - 16) / 3.0 * 4.0, (pp->PY - 12) / 3.0 * 4.0, (pp->PZ - 16) / 3.0 * 4.0); - mySphere(elbowradius); + mySphere(elbowradius, wire); break; case 2: case 3: