1 /* sballs --- balls spinning like crazy in GL */
4 static const char sccsid[] = "@(#)sballs.c 5.02 2001/03/10 xlockmore";
7 /* Copyright (c) E. Lassauge, 2001. */
10 * Permission to use, copy, modify, and distribute this software and its
11 * documentation for any purpose and without fee is hereby granted,
12 * provided that the above copyright notice appear in all copies and that
13 * both that copyright notice and this permission notice appear in
14 * supporting documentation.
16 * This file is provided AS IS with no warranties of any kind. The author
17 * shall have no liability with respect to the infringement of copyrights,
18 * trade secrets or any patents by this file or any part thereof. In no
19 * event will the author be liable for any lost revenue or profits or
20 * other special, indirect and consequential damages.
22 * The original code for this mode was written by
23 * Mustata Bogdan (LoneRunner) <lonerunner@planetquake.com>
24 * and can be found at http://www.cfxweb.net/lonerunner/
26 * Eric Lassauge (November-07-2000) <lassauge@users.sourceforge.net>
27 * http://lassauge.free.fr/linux.html
31 * E.Lassauge - 03-Oct-2001:
32 * - minor bugfixes - get ready for xscreensaver
33 * E.Lassauge - 09-Mar-2001:
34 * - get rid of my framerate options to use showfps
35 * E.Lassauge - 28-Nov-2000:
36 * - add handling of polyhedrons (like in ico)
37 * - modified release part to add freeing of GL objects
38 * E.Lassauge - 14-Nov-2000:
39 * - use new common xpm_to_ximage function
43 #ifdef STANDALONE /* xscreensaver mode */
44 #define PROGCLASS "Sballs"
45 #define HACK_INIT init_sballs
46 #define HACK_DRAW draw_sballs
47 #define HACK_RESHAPE reshape_sballs
48 #define sballs_opts xlockmore_opts
49 #define DEFAULTS "*delay: 30000 \n" \
53 "*trackmouse: False \n" \
54 "*showFPS: False \n" \
55 "*wireframe: False \n" \
59 #include "xlockmore.h" /* from the xscreensaver distribution */
60 #else /* !STANDALONE */
61 #include "xlock.h" /* from the xlockmore distribution */
63 #endif /* !STANDALONE */
67 #define MINSIZE 32 /* minimal viewport size */
68 #define FRAME 50 /* frame count interval */
69 #define MAX_OBJ 8 /* number of 3D objects */
75 #if defined( USE_XPM ) || defined( USE_XPMINC ) || defined( HAVE_XPM )
76 /* USE_XPM & USE_XPMINC in xlock mode ; HAVE_XPM in xscreensaver mode */
77 # include "xpm-ximage.h"
83 __extension__ /* don't warn about "string length is greater than the length
84 ISO C89 compilers are required to support" when including
85 the following XPM file... */
87 # include "../images/sball.xpm"
91 # include "../images/sball-bg.xpm"
92 # else /* !STANDALONE */
93 # include "pixmaps/sball.xpm"
94 # include "pixmaps/sball-bg.xpm"
95 # endif /* !STANDALONE */
98 /* Manage option vars */
99 #define DEF_TEXTURE "True"
100 #define DEF_TRACKMOUSE "False"
101 #define DEF_OBJECT "0"
102 static Bool do_texture;
103 static Bool do_trackmouse;
107 static XrmOptionDescRec opts[] = {
108 {"-texture", ".sballs.texture", XrmoptionNoArg, "on"},
109 {"+texture", ".sballs.texture", XrmoptionNoArg, "off"},
110 {"-trackmouse", ".sballs.trackmouse", XrmoptionNoArg, "on"},
111 {"+trackmouse", ".sballs.trackmouse", XrmoptionNoArg, "off"},
112 {"-object", ".sballs.object", XrmoptionSepArg, 0},
116 static argtype vars[] = {
117 {&do_texture, "texture", "Texture", DEF_TEXTURE, t_Bool},
118 {&do_trackmouse, "trackmouse", "TrackMouse", DEF_TRACKMOUSE, t_Bool},
119 {&object, "object", "Object", DEF_OBJECT, t_Int},
123 static OptionStruct desc[] = {
124 /*{"-count spheres", "set number of spheres"},*/
125 /*{"-cycles speed", "set ball speed value"},*/
126 {"-/+texture", "turn on/off texturing"},
127 {"-/+trackmouse", "turn on/off the tracking of the mouse"},
128 {"-object num", "number of the 3D object (0 means random)"},
131 ModeSpecOpt sballs_opts =
132 { sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc };
135 ModStruct sballs_description =
136 { "sballs", "init_sballs", "draw_sballs", "release_sballs",
137 "draw_sballs", "change_sballs", (char *) NULL, &sballs_opts,
139 delay,count,cycles,size,ncolors,sat
141 10000, 0, 10, 400, 64, 1.0, "",
142 "balls spinning like crazy in GL", 0, NULL
144 #endif /* USE_MODULES */
146 /* misc types and defines */
147 #define vinit(a,i,j,k) {\
153 typedef vec_t vec3_t[3];
157 /* the mode struct, contains all per screen variables */
159 GLint WIDTH, HEIGHT; /* display dimensions */
160 GLXContext *glx_context;
163 XImage *btexture; /* back texture image bits */
164 XImage *ftexture; /* face texture image bits */
165 GLuint backid; /* back texture id: GL world */
166 GLuint faceid; /* face texture id: GL world */
172 float radius[MAX_BALLS];
176 /* array of sballsstruct indexed by screen number */
177 static sballsstruct *sballs = (sballsstruct *) NULL;
180 static float LightAmbient[]= { 1.0f, 1.0f, 1.0f, 1.0f };
181 static float LightDiffuse[]= { 1.0f, 1.0f, 1.0f, 1.0f };
182 static float LightPosition[]= { 0.0f, 0.0f, 4.0f, 1.0f };
184 /* structure of the polyhedras */
186 const char *longname; /* long name of object */
187 const char *shortname; /* short name of object */
188 int numverts; /* number of vertices */
189 float radius; /* radius */
190 vec3_t v[MAX_BALLS];/* the vertices */
193 static Polyinfo polygons[] =
196 /* 0: objtetra - structure values for tetrahedron */
198 "tetrahedron", "tetra", /* long and short names */
199 4, /* number of vertices */
201 { /* vertices (x,y,z) */
202 /* all points must be within radius 2 of the origin */
212 /* 1: objcube - structure values for cube */
215 "hexahedron", "cube", /* long and short names */
216 8, /* number of vertices, edges, and faces */
218 { /* vertices (x,y,z) */
219 /* all points must be within radius 2 of the origin */
233 /* 2: objocta - structure values for octahedron */
236 "octahedron", "octa", /* long and short names */
237 6, /* number of vertices */
239 { /* vertices (x,y,z) */
240 /* all points must be within radius 2 of the origin */
251 /* 3: objdodec - structure values for dodecahedron */
254 "dodecahedron", "dodeca", /* long and short names */
255 20, /* number of vertices */
257 { /* vertices (x,y,z) */
258 /* all points must be within radius 2 of the origin */
259 {0.000000, 0.500000, 1.000000},
260 {0.000000, -0.500000, 1.000000},
261 {0.000000, -0.500000, -1.000000},
262 {0.000000, 0.500000, -1.000000},
263 {1.000000, 0.000000, 0.500000},
264 {-1.000000, 0.000000, 0.500000},
265 {-1.000000, 0.000000, -0.500000},
266 {1.000000, 0.000000, -0.500000},
267 {0.500000, 1.000000, 0.000000},
268 {-0.500000, 1.000000, 0.000000},
269 {-0.500000, -1.000000, 0.000000},
270 {0.500000, -1.000000, 0.000000},
271 {0.750000, 0.750000, 0.750000},
272 {-0.750000, 0.750000, 0.750000},
273 {-0.750000, -0.750000, 0.750000},
274 {0.750000, -0.750000, 0.750000},
275 {0.750000, -0.750000, -0.750000},
276 {0.750000, 0.750000, -0.750000},
277 {-0.750000, 0.750000, -0.750000},
278 {-0.750000, -0.750000, -0.750000},
282 /* 4: objicosa - structure values for icosahedron */
285 "icosahedron", "icosa", /* long and short names */
286 12, /* number of vertices */
288 { /* vertices (x,y,z) */
289 /* all points must be within radius 2 of the origin */
290 {0.00000000, 0.00000000, -0.95105650},
291 {0.00000000, 0.85065080, -0.42532537},
292 {0.80901698, 0.26286556, -0.42532537},
293 {0.50000000, -0.68819095, -0.42532537},
294 {-0.50000000, -0.68819095, -0.42532537},
295 {-0.80901698, 0.26286556, -0.42532537},
296 {0.50000000, 0.68819095, 0.42532537},
297 {0.80901698, -0.26286556, 0.42532537},
298 {0.00000000, -0.85065080, 0.42532537},
299 {-0.80901698, -0.26286556, 0.42532537},
300 {-0.50000000, 0.68819095, 0.42532537},
301 {0.00000000, 0.00000000, 0.95105650}
305 /* 5: objplane - structure values for plane */
308 "plane", "plane", /* long and short names */
309 4, /* number of vertices */
311 { /* vertices (x,y,z) */
312 /* all points must be within radius 2 of the origin */
322 /* 6: objpyr - structure values for pyramid */
325 "pyramid", "pyramid", /* long and short names */
326 5, /* number of vertices */
328 { /* vertices (x,y,z) */
329 /* all points must be within radius 1 of the origin */
340 /* 7: objstar - structure values for octahedron star (stellated octahedron?) */
342 "star", "star", /* long and short names */
343 8, /* number of vertices */
345 { /* vertices (x,y,z) */
346 /* all points must be within radius 1 of the origin */
366 *-----------------------------------------------------------------------------
367 *-----------------------------------------------------------------------------
369 *-----------------------------------------------------------------------------
370 *-----------------------------------------------------------------------------
373 static void clamp(vec3_t v)
377 for (i = 0; i < 3; i ++)
378 if (v[i] > 360 || v[i] < -360)
382 /* track the mouse in a joystick manner : not perfect but it works */
383 static void trackmouse(ModeInfo * mi)
385 sballsstruct *sb = &sballs[MI_SCREEN(mi)];
386 /* we keep static values (not per screen) for the mouse stuff: in general you have only one mouse :-> */
387 static int max[2] = { 0, 0 };
388 static int min[2] = { 0x7fffffff, 0x7fffffff }, center[2];
393 (void) XQueryPointer(MI_DISPLAY(mi), MI_WINDOW(mi),
394 &r, &c, &rx, &ry, &cx, &cy, &m);
400 center[0] = (max[0] + min[0]) / 2;
406 center[1] = (max[1] + min[1]) / 2;
408 if (fabs(center[0] - (float) cx) > 0.1 * (max[0] - min[0]))
409 sb->rot[0] -= ((center[0] - (float) cx) / (max[0] - min[0]) * 180.0f) / 200.0f;
410 if (fabs(center[1] - (float) cy) > 0.1 * (max[1] - min[1]))
411 sb->rot[1] -= ((center[1] - (float) cy) / (max[1] - min[1]) * 180.0f) / 200.0f;;
414 /* oops: can't get those buttons */
422 /* initialise textures */
423 static void inittextures(ModeInfo * mi)
425 sballsstruct *sb = &sballs[MI_SCREEN(mi)];
427 #if defined( I_HAVE_XPM )
430 glGenTextures(1, &sb->backid);
431 #ifdef HAVE_GLBINDTEXTURE
432 glBindTexture(GL_TEXTURE_2D, sb->backid);
433 #endif /* HAVE_GLBINDTEXTURE */
435 sb->btexture = xpm_to_ximage(MI_DISPLAY(mi),
439 if (!(sb->btexture)) {
440 (void) fprintf(stderr, "Error reading the background texture.\n");
441 glDeleteTextures(1, &sb->backid);
443 sb->faceid = 0; /* default textures */
448 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
450 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA,
451 sb->btexture->width, sb->btexture->height, 0,
453 /* GL_UNSIGNED_BYTE, */
454 GL_UNSIGNED_INT_8_8_8_8_REV,
456 check_gl_error("texture");
458 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
459 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
461 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
462 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
464 glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
466 glGenTextures(1, &sb->faceid);
467 #ifdef HAVE_GLBINDTEXTURE
468 glBindTexture(GL_TEXTURE_2D, sb->faceid);
469 #endif /* HAVE_GLBINDTEXTURE */
471 sb->ftexture = xpm_to_ximage(MI_DISPLAY(mi),
475 if (!(sb->ftexture)) {
476 (void) fprintf(stderr, "Error reading the face texture.\n");
477 glDeleteTextures(1, &sb->faceid);
482 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
484 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA,
485 sb->ftexture->width, sb->ftexture->height, 0,
487 /* GL_UNSIGNED_BYTE, */
488 GL_UNSIGNED_INT_8_8_8_8_REV,
490 check_gl_error("texture");
492 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
493 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
495 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
496 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
498 glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
502 sb->faceid = 0; /* default textures */
505 #else /* !I_HAVE_XPM */
507 sb->faceid = 0; /* default textures */
509 #endif /* !I_HAVE_XPM */
512 static void drawSphere(ModeInfo * mi,int sphere_num)
514 sballsstruct *sb = &sballs[MI_SCREEN(mi)];
515 float x = polygons[object].v[sphere_num][0];
516 float y = polygons[object].v[sphere_num][1];
517 float z = polygons[object].v[sphere_num][2];
520 float radius = sb->radius[sphere_num];
521 double majorStep = (M_PI / numMajor);
522 double minorStep = (2.0 * M_PI / numMinor);
526 glTranslatef(x, y, z);
528 glColor4f(1, 1, 1, 1);
529 for (i = 0; i < numMajor; ++i)
531 double a = i * majorStep;
532 double b = a + majorStep;
533 double r0 = radius * sin(a);
534 double r1 = radius * sin(b);
535 GLfloat z0 = radius * cos(a);
536 GLfloat z1 = radius * cos(b);
538 glBegin(MI_IS_WIREFRAME(mi) ? GL_LINE_STRIP: GL_TRIANGLE_STRIP);
539 for (j = 0; j <= numMinor; ++j)
541 double c = j * minorStep;
545 glNormal3f((x * r0) / radius, (y * r0) / radius, z0 / radius);
546 glTexCoord2f(j / (GLfloat) numMinor, i / (GLfloat) numMajor);
547 glVertex3f(x * r0, y * r0, z0);
549 glNormal3f((x * r1) / radius, (y * r1) / radius, z1 / radius);
550 glTexCoord2f(j / (GLfloat) numMinor, (i + 1) / (GLfloat) numMajor);
551 glVertex3f(x * r1, y * r1, z1);
562 *-----------------------------------------------------------------------------
563 *-----------------------------------------------------------------------------
565 *-----------------------------------------------------------------------------
566 *-----------------------------------------------------------------------------
570 static void Reshape(ModeInfo * mi)
572 void reshape_sballs(ModeInfo * mi, int width, int height)
576 sballsstruct *sb = &sballs[MI_SCREEN(mi)];
577 int size = MI_SIZE(mi);
579 /* Viewport is specified size if size >= MINSIZE && size < screensize */
581 sb->WIDTH = MI_WIDTH(mi);
582 sb->HEIGHT = MI_HEIGHT(mi);
583 } else if (size < MINSIZE) {
585 sb->HEIGHT = MINSIZE;
587 sb->WIDTH = (size > MI_WIDTH(mi)) ? MI_WIDTH(mi) : size;
588 sb->HEIGHT = (size > MI_HEIGHT(mi)) ? MI_HEIGHT(mi) : size;
590 glViewport((MI_WIDTH(mi) - sb->WIDTH) / 2, (MI_HEIGHT(mi) - sb->HEIGHT) / 2, sb->WIDTH, sb->HEIGHT);
591 glMatrixMode(GL_PROJECTION);
593 gluPerspective(55.0, (float)sb->WIDTH / (float) sb->HEIGHT, 1.0, 300.0);
595 glMatrixMode(GL_MODELVIEW);
599 static void Draw(ModeInfo * mi)
601 sballsstruct *sb = &sballs[MI_SCREEN(mi)];
604 mi->polygon_count = 0;
606 if (do_trackmouse && !MI_IS_ICONIC(mi))
609 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
612 glEnable(GL_DEPTH_TEST);
615 glTranslatef (-sb->eye[0], -sb->eye[1], -sb->eye[2]);
617 /* draw background */
620 glEnable(GL_LIGHTING);
621 glEnable(GL_TEXTURE_2D);
623 #ifdef HAVE_GLBINDTEXTURE
624 glBindTexture(GL_TEXTURE_2D, sb->backid);
625 #endif /* HAVE_GLBINDTEXTURE */
631 glBegin(GL_QUAD_STRIP);
632 glNormal3f(0, 0, 1); glTexCoord2f(0,0); glVertex3f(8, 4.1, -4);
633 glNormal3f(0, 0, 1); glTexCoord2f(0,1); glVertex3f(8, -4.1, -4);
634 glNormal3f(0, 0, 1); glTexCoord2f(1,0); glVertex3f(-8, 4.1, -4);
635 glNormal3f(0, 0, 1); glTexCoord2f(1,1); glVertex3f(-8, -4.1, -4);
639 /* rotate the mouse */
640 glRotatef(sb->rot[0], 1.0f, 0.0f, 0.0f);
641 glRotatef(sb->rot[1], 0.0f, 1.0f, 0.0f);
642 glRotatef(sb->rot[2], 0.0f, 0.0f, 1.0f);
644 /* rotate the balls */
645 glRotatef(sb->rotm[0], 1.0f, 0.0f, 0.0f);
646 glRotatef(sb->rotm[1], 0.0f, 1.0f, 0.0f);
647 glRotatef(sb->rotm[2], 0.0f, 0.0f, 1.0f);
649 sb->rotm[0] += sb->speed;
650 sb->rotm[1] += -(sb->speed);
655 #ifdef HAVE_GLBINDTEXTURE
656 glBindTexture(GL_TEXTURE_2D, sb->faceid);
657 #endif /* HAVE_GLBINDTEXTURE */
659 glEnable(GL_LIGHTING);
660 for (sphere=0;sphere<spheres;sphere++)
662 drawSphere(mi,sphere);
665 glDisable(GL_TEXTURE_2D);
666 glDisable(GL_DEPTH_TEST);
667 glDisable(GL_LIGHTING);
669 /* manage framerate display */
670 if (MI_IS_FPS(mi)) do_fps (mi);
675 static void Init(ModeInfo * mi)
677 sballsstruct *sb = &sballs[MI_SCREEN(mi)];
680 /* Default settings */
681 if (MI_IS_WIREFRAME(mi))
687 sb->btexture = (XImage*) NULL;
688 sb->ftexture = (XImage*) NULL;
691 vinit(sb->eye ,0.0f, 0.0f, 6.0f);
692 vinit(sb->rot ,0.0f, 0.0f, 0.0f);
693 vinit(sb->rotm ,0.0f, 0.0f, 0.0f);
694 sb->speed = MI_CYCLES(mi);
696 /* initialise object number */
697 if ((object == 0) || (object > MAX_OBJ))
698 object = NRAND(MAX_OBJ-1)+1;
701 /* initialise sphere number */
702 spheres = MI_COUNT(mi);
703 if (MI_COUNT(mi) > polygons[object].numverts)
704 spheres = polygons[object].numverts;
705 if (MI_COUNT(mi) < 1)
706 spheres = polygons[object].numverts;
707 /* initialise sphere radius */
708 for(i=0; i < spheres;i++)
711 sb->radius[i] = ((float) LRAND() / (float) MAXRAND);
712 if (sb->radius[i] < 0.3)
714 if (sb->radius[i] > 0.7)
717 sb->radius[i] = polygons[object].radius;
721 if (MI_IS_DEBUG(mi)) {
722 (void) fprintf(stderr,
723 "%s:\n\tobject=%s\n\tspheres=%d\n\tspeed=%d\n\ttexture=%s\n",
725 polygons[object].shortname,
728 do_texture ? "on" : "off"
732 glLightfv(GL_LIGHT1, GL_AMBIENT, LightAmbient);
733 glLightfv(GL_LIGHT1, GL_DIFFUSE, LightDiffuse);
734 glLightfv(GL_LIGHT1, GL_POSITION,LightPosition);
737 glClearColor(0, 0, 0, 0);
741 *-----------------------------------------------------------------------------
742 *-----------------------------------------------------------------------------
744 *-----------------------------------------------------------------------------
745 *-----------------------------------------------------------------------------
749 *-----------------------------------------------------------------------------
750 * Initialize sballs. Called each time the window changes.
751 *-----------------------------------------------------------------------------
754 void init_sballs(ModeInfo * mi)
758 if (sballs == NULL) {
759 if ((sballs = (sballsstruct *) calloc(MI_NUM_SCREENS(mi),
760 sizeof(sballsstruct))) == NULL)
763 sb = &sballs[MI_SCREEN(mi)];
765 if ((sb->glx_context = init_GL(mi)) != NULL) {
768 Reshape(mi); /* xlock mode */
770 reshape_sballs(mi,MI_WIDTH(mi),MI_HEIGHT(mi)); /* xscreensaver mode */
772 glDrawBuffer(GL_BACK);
781 *-----------------------------------------------------------------------------
782 * Called by the mainline code periodically to update the display.
783 *-----------------------------------------------------------------------------
785 void draw_sballs(ModeInfo * mi)
787 Display *display = MI_DISPLAY(mi);
788 Window window = MI_WINDOW(mi);
793 sb = &sballs[MI_SCREEN(mi)];
795 MI_IS_DRAWN(mi) = True;
796 if (!sb->glx_context)
799 glXMakeCurrent(display, window, *(sb->glx_context));
802 Reshape(mi); /* xlock mode */
804 reshape_sballs(mi,MI_WIDTH(mi),MI_HEIGHT(mi)); /* xscreensaver mode */
808 glXSwapBuffers(display, window);
813 *-----------------------------------------------------------------------------
814 * The display is being taken away from us. Free up malloc'ed
815 * memory and X resources that we've alloc'ed. Only called
816 * once, we must zap everything for every screen.
817 *-----------------------------------------------------------------------------
820 void release_sballs(ModeInfo * mi)
824 if (sballs != NULL) {
825 for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) {
826 sballsstruct *sb = &sballs[screen];
829 glDeleteTextures(1,&sb->backid);
830 XDestroyImage(sb->btexture);
834 glDeleteTextures(1,&sb->faceid);
835 XDestroyImage(sb->ftexture);
838 (void) free((void *) sballs);
839 sballs = (sballsstruct *) NULL;
844 void change_sballs(ModeInfo * mi)
850 sb = &sballs[MI_SCREEN(mi)];
852 if (!sb->glx_context)
855 /* initialise object number */
856 if ((object == 0) || (object > MAX_OBJ))
857 object = NRAND(MAX_OBJ-1)+1;
860 /* correct sphere number */
861 spheres = MI_COUNT(mi);
862 if (MI_COUNT(mi) > polygons[object].numverts)
863 spheres = polygons[object].numverts;
864 if (MI_COUNT(mi) < 1)
865 spheres = polygons[object].numverts;
867 if (MI_IS_DEBUG(mi)) {
868 (void) fprintf(stderr,
869 "%s:\n\tobject=%s\n\tspheres=%d\n\tspeed=%d\n\ttexture=%s\n",
871 polygons[object].shortname,
874 do_texture ? "on" : "off"
877 glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(sb->glx_context));
880 #endif /* MODE_sballs */