1 /* -*- Mode: C; tab-width: 4 -*- */
2 /* moebius --- Moebius Strip II, an Escher-like GL scene with ants. */
5 static const char sccsid[] = "@(#)moebius.c 5.01 2001/03/01 xlockmore";
9 * Permission to use, copy, modify, and distribute this software and its
10 * documentation for any purpose and without fee is hereby granted,
11 * provided that the above copyright notice appear in all copies and that
12 * both that copyright notice and this permission notice appear in
13 * supporting documentation.
15 * This file is provided AS IS with no warranties of any kind. The author
16 * shall have no liability with respect to the infringement of copyrights,
17 * trade secrets or any patents by this file or any part thereof. In no
18 * event will the author be liable for any lost revenue or profits or
19 * other special, indirect and consequential damages.
21 * The RotateAroundU() routine was adapted from the book
22 * "Computer Graphics Principles and Practice
23 * Foley - vanDam - Feiner - Hughes
24 * Second Edition" Pag. 227, exercise 5.15.
26 * This mode shows some interesting scenes that are impossible OR very
27 * wierd to build in the real universe. Much of the scenes are inspirated
28 * on Mauritz Cornelis Escher's works which derivated the mode's name.
29 * M.C. Escher (1898-1972) was a dutch artist and many people prefer to
30 * say he was a mathematician.
32 * Thanks goes to Brian Paul for making it possible and inexpensive to use
35 * Since I'm not a native English speaker, my apologies for any grammatical
38 * My e-mail address is
39 * mfvianna@centroin.com.br
41 * Marcelo F. Vianna (Jun-01-1997)
44 * 05-Apr-2002: Removed all gllist uses (fix some bug with nvidia driver)
45 * 01-Mar-2001: backported from xscreensaver by lassauge@mail.dotcom.fr
46 * Feb-2001: Made motion and rotation be smoother Jamie Zawinski
48 * 01-Nov-2000: Allocation checks
49 * 01-Jan-1998: Mode separated from escher and renamed
50 * 08-Jun-1997: New scene implemented: "Impossible Cage" based in a M.C.
51 * Escher's painting with the same name (quite similar). The
52 * first GL mode to use texture mapping.
53 * The "Impossible Cage" scene doesn't use DEPTH BUFFER, the
54 * wood planks are drawn consistently using GL_CULL_FACE, and
55 * the painter's algorithm is used to sort the planks.
57 * 07-Jun-1997: Speed ups in Moebius Strip using GL_CULL_FACE.
59 * 03-Jun-1997: Initial Release (Only one scene: "Moebius Strip")
60 * The Moebius Strip scene was inspirated in a M.C. Escher's
61 * painting named Moebius Strip II in wich ants walk across a
62 * Moebius Strip path, sometimes meeting each other and sometimes
63 * being in "opposite faces" (note that the moebius strip has
64 * only one face and one edge).
69 * Texture mapping is only available on RGBA contexts, Mono and color index
70 * visuals DO NOT support texture mapping in OpenGL.
72 * BUT Mesa do implements RGBA contexts in pseudo color visuals, so texture
73 * mapping shuld work on PseudoColor, DirectColor, TrueColor using Mesa. Mono
74 * is not officially supported for both OpenGL and Mesa, but seems to not crash
77 * In real OpenGL, PseudoColor DO NOT support texture map (as far as I know).
82 # define refresh_moebius 0
83 # define DEFAULTS "*delay: 20000 \n" \
86 # include "xlockmore.h" /* from the xscreensaver distribution */
87 #else /* !STANDALONE */
88 # include "xlock.h" /* from the xlockmore distribution */
89 #endif /* !STANDALONE */
93 #include "e_textures.h"
95 #include "gltrackball.h"
97 #define DEF_SOLIDMOEBIUS "False"
98 #define DEF_DRAWANTS "True"
100 static int solidmoebius;
103 static XrmOptionDescRec opts[] =
105 {"-solidmoebius", ".moebius.solidmoebius", XrmoptionNoArg, "on"},
106 {"+solidmoebius", ".moebius.solidmoebius", XrmoptionNoArg, "off"},
107 {"-ants", ".moebius.drawants", XrmoptionNoArg, "on"},
108 {"+ants", ".moebius.drawants", XrmoptionNoArg, "off"}
110 static argtype vars[] =
112 {&solidmoebius, "solidmoebius", "Solidmoebius", DEF_SOLIDMOEBIUS, t_Bool},
113 {&drawants, "drawants", "Drawants", DEF_DRAWANTS, t_Bool}
116 static OptionStruct desc[] =
118 {"-/+solidmoebius", "select between a SOLID or a NET Moebius Strip"},
119 {"-/+drawants", "turn on/off walking ants"}
122 ENTRYPOINT ModeSpecOpt moebius_opts =
123 {sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
126 ModStruct moebius_description =
127 {"moebius", "init_moebius", "draw_moebius", "release_moebius",
128 "draw_moebius", "change_moebius", (char *) NULL, &moebius_opts,
129 1000, 1, 1, 1, 4, 1.0, "",
130 "Shows Moebius Strip II, an Escher-like GL scene with ants", 0, NULL};
134 #define Scale4Window 0.3
135 #define Scale4Iconic 0.4
137 #define sqr(A) ((A)*(A))
143 #define ObjMoebiusStrip 0
147 /*************************************************************************/
152 GLfloat ant_position;
154 GLXContext *glx_context;
156 trackball_state *trackball;
160 static const float front_shininess[] = {60.0};
161 static const float front_specular[] = {0.7, 0.7, 0.7, 1.0};
162 static const float ambient[] = {0.0, 0.0, 0.0, 1.0};
163 static const float diffuse[] = {1.0, 1.0, 1.0, 1.0};
164 static const float position0[] = {1.0, 1.0, 1.0, 0.0};
165 static const float position1[] = {-1.0, -1.0, 1.0, 0.0};
166 static const float lmodel_ambient[] = {0.5, 0.5, 0.5, 1.0};
167 static const float lmodel_twoside[] = {GL_TRUE};
169 static const float MaterialRed[] = {0.7, 0.0, 0.0, 1.0};
170 static const float MaterialGreen[] = {0.1, 0.5, 0.2, 1.0};
171 static const float MaterialBlue[] = {0.0, 0.0, 0.7, 1.0};
172 static const float MaterialCyan[] = {0.2, 0.5, 0.7, 1.0};
173 static const float MaterialYellow[] = {0.7, 0.7, 0.0, 1.0};
174 static const float MaterialMagenta[] = {0.6, 0.2, 0.5, 1.0};
175 static const float MaterialWhite[] = {0.7, 0.7, 0.7, 1.0};
176 static const float MaterialGray[] = {0.2, 0.2, 0.2, 1.0};
177 static const float MaterialGray5[] = {0.5, 0.5, 0.5, 1.0};
178 static const float MaterialGray6[] = {0.6, 0.6, 0.6, 1.0};
179 static const float MaterialGray8[] = {0.8, 0.8, 0.8, 1.0};
181 static moebiusstruct *moebius = (moebiusstruct *) NULL;
186 mySphere(float radius)
188 GLUquadricObj *quadObj;
190 if ((quadObj = gluNewQuadric()) == 0)
192 gluQuadricDrawStyle(quadObj, (GLenum) GLU_FILL);
193 gluSphere(quadObj, radius, 16, 16);
194 gluDeleteQuadric(quadObj);
201 GLUquadricObj *quadObj;
203 if ((quadObj = gluNewQuadric()) == 0)
205 gluQuadricDrawStyle(quadObj, (GLenum) GLU_FILL);
206 gluCylinder(quadObj, radius, 0, radius * 3, 8, 1);
207 gluDeleteQuadric(quadObj);
212 draw_moebius_ant(moebiusstruct * mp, const float *Material, int mono)
214 float cos1 = cos(mp->ant_step);
215 float cos2 = cos(mp->ant_step + 2 * Pi / 3);
216 float cos3 = cos(mp->ant_step + 4 * Pi / 3);
217 float sin1 = sin(mp->ant_step);
218 float sin2 = sin(mp->ant_step + 2 * Pi / 3);
219 float sin3 = sin(mp->ant_step + 4 * Pi / 3);
222 glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialGray5);
224 glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, Material);
225 glEnable(GL_CULL_FACE);
230 glScalef(1, 1 / 1.3, 1);
231 glTranslatef(0.00, 0.30, 0.00);
235 glTranslatef(-0.05, 0.17, 0.05);
236 glRotatef(-90, 1, 0, 0);
237 glRotatef(-25, 0, 1, 0);
240 glTranslatef(0.00, 0.10, 0.00);
243 glRotatef(25, 0, 1, 0);
244 glRotatef(90, 1, 0, 0);
247 glTranslatef(0.15, -0.65, 0.05);
250 glScalef(1, 1 / 1.3, 1);
252 glDisable(GL_CULL_FACE);
254 glDisable(GL_LIGHTING);
258 glColor3fv(MaterialGray5);
260 glColor3fv(Material);
261 glVertex3f(0.00, 0.30, 0.00);
262 glColor3fv(MaterialGray);
263 glVertex3f(0.40, 0.70, 0.40);
265 glColor3fv(MaterialGray5);
267 glColor3fv(Material);
268 glVertex3f(0.00, 0.30, 0.00);
269 glColor3fv(MaterialGray);
270 glVertex3f(0.40, 0.70, -0.40);
274 glColor3fv(MaterialGray6);
276 glColor3fv(MaterialRed);
277 glVertex3f(0.40, 0.70, 0.40);
278 glVertex3f(0.40, 0.70, -0.40);
282 glBegin(GL_LINE_STRIP);
284 glColor3fv(MaterialGray5);
286 glColor3fv(Material);
287 glVertex3f(0.00, 0.05, 0.18);
288 glVertex3f(0.35 + 0.05 * cos1, 0.15, 0.25);
289 glColor3fv(MaterialGray);
290 glVertex3f(-0.20 + 0.05 * cos1, 0.25 + 0.1 * sin1, 0.45);
293 /* LEFT-CENTER ARM */
294 glBegin(GL_LINE_STRIP);
296 glColor3fv(MaterialGray5);
298 glColor3fv(Material);
299 glVertex3f(0.00, 0.00, 0.18);
300 glVertex3f(0.35 + 0.05 * cos2, 0.00, 0.25);
301 glColor3fv(MaterialGray);
302 glVertex3f(-0.20 + 0.05 * cos2, 0.00 + 0.1 * sin2, 0.45);
306 glBegin(GL_LINE_STRIP);
308 glColor3fv(MaterialGray5);
310 glColor3fv(Material);
311 glVertex3f(0.00, -0.05, 0.18);
312 glVertex3f(0.35 + 0.05 * cos3, -0.15, 0.25);
313 glColor3fv(MaterialGray);
314 glVertex3f(-0.20 + 0.05 * cos3, -0.25 + 0.1 * sin3, 0.45);
317 /* RIGHT-FRONT ARM */
318 glBegin(GL_LINE_STRIP);
320 glColor3fv(MaterialGray5);
322 glColor3fv(Material);
323 glVertex3f(0.00, 0.05, -0.18);
324 glVertex3f(0.35 - 0.05 * sin1, 0.15, -0.25);
325 glColor3fv(MaterialGray);
326 glVertex3f(-0.20 - 0.05 * sin1, 0.25 + 0.1 * cos1, -0.45);
329 /* RIGHT-CENTER ARM */
330 glBegin(GL_LINE_STRIP);
332 glColor3fv(MaterialGray5);
334 glColor3fv(Material);
335 glVertex3f(0.00, 0.00, -0.18);
336 glVertex3f(0.35 - 0.05 * sin2, 0.00, -0.25);
337 glColor3fv(MaterialGray);
338 glVertex3f(-0.20 - 0.05 * sin2, 0.00 + 0.1 * cos2, -0.45);
342 glBegin(GL_LINE_STRIP);
344 glColor3fv(MaterialGray5);
346 glColor3fv(Material);
347 glVertex3f(0.00, -0.05, -0.18);
348 glVertex3f(0.35 - 0.05 * sin3, -0.15, -0.25);
349 glColor3fv(MaterialGray);
350 glVertex3f(-0.20 - 0.05 * sin3, -0.25 + 0.1 * cos3, -0.45);
355 glColor3fv(MaterialGray8);
357 glColor3fv(MaterialMagenta);
358 glVertex3f(-0.20 + 0.05 * cos1, 0.25 + 0.1 * sin1, 0.45);
359 glVertex3f(-0.20 + 0.05 * cos2, 0.00 + 0.1 * sin2, 0.45);
360 glVertex3f(-0.20 + 0.05 * cos3, -0.25 + 0.1 * sin3, 0.45);
361 glVertex3f(-0.20 - 0.05 * sin1, 0.25 + 0.1 * cos1, -0.45);
362 glVertex3f(-0.20 - 0.05 * sin2, 0.00 + 0.1 * cos2, -0.45);
363 glVertex3f(-0.20 - 0.05 * sin3, -0.25 + 0.1 * cos3, -0.45);
366 glEnable(GL_LIGHTING);
373 RotateAaroundU(float Ax, float Ay, float Az,
374 float Ux, float Uy, float Uz,
375 float *Cx, float *Cy, float *Cz,
378 float cosO = cos(Theta);
379 float sinO = sin(Theta);
380 float one_cosO = 1 - cosO;
384 float UxUy = Ux * Uy;
385 float UxUz = Ux * Uz;
386 float UyUz = Uy * Uz;
388 *Cx = (Ux2 + cosO * (1 - Ux2)) * Ax + (UxUy * one_cosO - Uz * sinO) * Ay + (UxUz * one_cosO + Uy * sinO) * Az;
389 *Cy = (UxUy * one_cosO + Uz * sinO) * Ax + (Uy2 + cosO * (1 - Uy2)) * Ay + (UyUz * one_cosO - Ux * sinO) * Az;
390 *Cz = (UxUz * one_cosO - Uy * sinO) * Ax + (UyUz * one_cosO + Ux * sinO) * Ay + (Uz2 + cosO * (1 - Uz2)) * Az;
393 #define MoebiusDivisions 40
394 #define MoebiusTransversals 4
396 draw_moebius_strip(ModeInfo * mi)
400 moebiusstruct *mp = &moebius[MI_SCREEN(mi)];
402 int mono = MI_IS_MONO(mi);
407 glBegin(GL_QUAD_STRIP);
410 while (i < (MoebiusDivisions * 2 + 1)) {
417 glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialWhite);
419 glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialRed);
421 glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialGray);
423 RotateAaroundU(cPhi, sPhi, 0, -sPhi, cPhi, 0, &Cx, &Cy, &Cz, Theta);
424 glNormal3f(Cx, Cy, Cz);
425 RotateAaroundU(0, 0, 1, -sPhi, cPhi, 0, &Cx, &Cy, &Cz, Theta);
426 glVertex3f(cPhi * 3 + Cx, sPhi * 3 + Cy, +Cz);
427 glVertex3f(cPhi * 3 - Cx, sPhi * 3 - Cy, -Cz);
429 Phi += Pi / MoebiusDivisions;
433 for (j = -MoebiusTransversals; j < MoebiusTransversals; j++) {
434 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
435 glBegin(GL_QUAD_STRIP);
438 while (i < (MoebiusDivisions * 2 + 1)) {
443 RotateAaroundU(cPhi, sPhi, 0, -sPhi, cPhi, 0, &Cx, &Cy, &Cz, Theta);
444 glNormal3f(Cx, Cy, Cz);
445 RotateAaroundU(0, 0, 1, -sPhi, cPhi, 0, &Cx, &Cy, &Cz, Theta);
447 if (j == MoebiusTransversals || mono)
448 glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialWhite);
450 glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialRed);
452 glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialGray);
453 glVertex3f(cPhi * 3 + Cx / MoebiusTransversals * j, sPhi * 3 + Cy / MoebiusTransversals * j, +Cz / MoebiusTransversals * j);
455 if (j == -MoebiusTransversals || mono)
456 glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialWhite);
458 glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialRed);
460 glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialGray);
461 glVertex3f(cPhi * 3 + Cx / MoebiusTransversals * j, sPhi * 3 + Cy / MoebiusTransversals * j, +Cz / MoebiusTransversals * j);
463 Phi += Pi / MoebiusDivisions;
468 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
474 glRotatef(mp->ant_position + 180, 0, 0, 1);
475 glTranslatef(3, 0, 0);
476 glRotatef(mp->ant_position / 2 + 90, 0, 1, 0);
477 glTranslatef(0.28, 0, -0.45);
478 if (!draw_moebius_ant(mp, MaterialYellow, mono))
482 /* DRAW YELLOW ANT */
484 glRotatef(mp->ant_position, 0, 0, 1);
485 glTranslatef(3, 0, 0);
486 glRotatef(mp->ant_position / 2, 0, 1, 0);
487 glTranslatef(0.28, 0, -0.45);
488 if (!draw_moebius_ant(mp, MaterialBlue, mono))
494 glRotatef(-mp->ant_position, 0, 0, 1);
495 glTranslatef(3, 0, 0);
496 glRotatef(-mp->ant_position / 2, 0, 1, 0);
497 glTranslatef(0.28, 0, 0.45);
498 glRotatef(180, 1, 0, 0);
499 if (!draw_moebius_ant(mp, MaterialGreen, mono))
505 glRotatef(-mp->ant_position + 180, 0, 0, 1);
506 glTranslatef(3, 0, 0);
507 glRotatef(-mp->ant_position / 2 + 90, 0, 1, 0);
508 glTranslatef(0.28, 0, 0.45);
509 glRotatef(180, 1, 0, 0);
510 if (!draw_moebius_ant(mp, MaterialCyan, mono))
514 mp->ant_position += 1;
517 #undef MoebiusDivisions
518 #undef MoebiusTransversals
521 reshape_moebius (ModeInfo * mi, int width, int height)
523 moebiusstruct *mp = &moebius[MI_SCREEN(mi)];
525 glViewport(0, 0, mp->WindW = (GLint) width, mp->WindH = (GLint) height);
526 glMatrixMode(GL_PROJECTION);
528 glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 15.0);
529 glMatrixMode(GL_MODELVIEW);
533 } else if (width >= 512) {
547 glClearColor(0.0, 0.0, 0.0, 1.0);
549 glLightfv(GL_LIGHT0, GL_AMBIENT, ambient);
550 glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse);
551 glLightfv(GL_LIGHT0, GL_POSITION, position0);
552 glLightfv(GL_LIGHT1, GL_AMBIENT, ambient);
553 glLightfv(GL_LIGHT1, GL_DIFFUSE, diffuse);
554 glLightfv(GL_LIGHT1, GL_POSITION, position1);
555 glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient);
556 glLightModelfv(GL_LIGHT_MODEL_TWO_SIDE, lmodel_twoside);
557 glEnable(GL_LIGHTING);
560 glEnable(GL_NORMALIZE);
565 glShadeModel(GL_SMOOTH);
566 glEnable(GL_DEPTH_TEST);
567 glDisable(GL_TEXTURE_2D);
568 glDisable(GL_CULL_FACE);
570 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
573 status = gluBuild2DMipmaps(GL_TEXTURE_2D, 3,
574 WoodTextureWidth, WoodTextureHeight,
575 GL_RGB, GL_UNSIGNED_BYTE, WoodTextureData);
578 const char *s = (char *) gluErrorString (status);
579 fprintf (stderr, "%s: error mipmapping %dx%d texture: %s\n",
580 progname, WoodTextureWidth, WoodTextureHeight,
581 (s ? s : "(unknown)"));
584 check_gl_error("mipmapping");
586 glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
587 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
588 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
589 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
590 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
592 glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, front_shininess);
593 glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, front_specular);
599 release_moebius (ModeInfo * mi)
601 if (moebius != NULL) {
602 (void) free((void *) moebius);
603 moebius = (moebiusstruct *) NULL;
609 moebius_handle_event (ModeInfo *mi, XEvent *event)
611 moebiusstruct *mp = &moebius[MI_SCREEN(mi)];
613 if (event->xany.type == ButtonPress &&
614 event->xbutton.button == Button1)
616 mp->button_down_p = True;
617 gltrackball_start (mp->trackball,
618 event->xbutton.x, event->xbutton.y,
619 MI_WIDTH (mi), MI_HEIGHT (mi));
622 else if (event->xany.type == ButtonRelease &&
623 event->xbutton.button == Button1)
625 mp->button_down_p = False;
628 else if (event->xany.type == ButtonPress &&
629 (event->xbutton.button == Button4 ||
630 event->xbutton.button == Button5 ||
631 event->xbutton.button == Button6 ||
632 event->xbutton.button == Button7))
634 gltrackball_mousewheel (mp->trackball, event->xbutton.button, 10,
635 !!event->xbutton.state);
638 else if (event->xany.type == MotionNotify &&
641 gltrackball_track (mp->trackball,
642 event->xmotion.x, event->xmotion.y,
643 MI_WIDTH (mi), MI_HEIGHT (mi));
652 init_moebius (ModeInfo * mi)
656 if (moebius == NULL) {
657 if ((moebius = (moebiusstruct *) calloc(MI_NUM_SCREENS(mi),
658 sizeof (moebiusstruct))) == NULL)
661 mp = &moebius[MI_SCREEN(mi)];
662 mp->step = NRAND(90);
663 mp->ant_position = NRAND(90);
666 double rot_speed = 0.3;
667 mp->rot = make_rotator (rot_speed, rot_speed, rot_speed, 1, 0, True);
668 mp->trackball = gltrackball_init ();
671 if ((mp->glx_context = init_GL(mi)) != NULL) {
673 reshape_moebius(mi, MI_WIDTH(mi), MI_HEIGHT(mi));
674 glDrawBuffer(GL_BACK);
682 draw_moebius (ModeInfo * mi)
686 Display *display = MI_DISPLAY(mi);
687 Window window = MI_WINDOW(mi);
691 mp = &moebius[MI_SCREEN(mi)];
693 MI_IS_DRAWN(mi) = True;
695 if (!mp->glx_context)
698 glXMakeCurrent(display, window, *(mp->glx_context));
700 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
704 glTranslatef(0.0, 0.0, -10.0);
706 gltrackball_rotate (mp->trackball);
708 if (!MI_IS_ICONIC(mi)) {
709 glScalef(Scale4Window * mp->WindH / mp->WindW, Scale4Window, Scale4Window);
711 glScalef(Scale4Iconic * mp->WindH / mp->WindW, Scale4Iconic, Scale4Iconic);
716 get_rotation (mp->rot, &x, &y, &z, !mp->button_down_p);
717 glRotatef (x * 360, 1.0, 0.0, 0.0);
718 glRotatef (y * 360, 0.0, 1.0, 0.0);
719 glRotatef (z * 360, 0.0, 0.0, 1.0);
723 if (!draw_moebius_strip(mi)) {
730 if (MI_IS_FPS(mi)) do_fps (mi);
733 glXSwapBuffers(display, window);
740 change_moebius (ModeInfo * mi)
742 moebiusstruct *mp = &moebius[MI_SCREEN(mi)];
744 if (!mp->glx_context)
747 glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(mp->glx_context));
750 #endif /* !STANDALONE */
753 XSCREENSAVER_MODULE ("Moebius", moebius)