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" \
52 "*showFPS: False \n" \
53 "*wireframe: False \n" \
56 #include "xlockmore.h" /* from the xscreensaver distribution */
57 #else /* !STANDALONE */
58 #include "xlock.h" /* from the xlockmore distribution */
60 #endif /* !STANDALONE */
64 #define MINSIZE 32 /* minimal viewport size */
65 #define FRAME 50 /* frame count interval */
66 #define MAX_OBJ 8 /* number of 3D objects */
72 #if defined( USE_XPM ) || defined( USE_XPMINC ) || defined( HAVE_XPM )
73 /* USE_XPM & USE_XPMINC in xlock mode ; HAVE_XPM in xscreensaver mode */
74 # include "xpm-ximage.h"
80 __extension__ /* don't warn about "string length is greater than the length
81 ISO C89 compilers are required to support" when including
82 the following XPM file... */
84 # include "../images/sball.xpm"
88 # include "../images/sball-bg.xpm"
89 # else /* !STANDALONE */
90 # include "pixmaps/sball.xpm"
91 # include "pixmaps/sball-bg.xpm"
92 # endif /* !STANDALONE */
95 /* Manage option vars */
96 #define DEF_TEXTURE "True"
97 #define DEF_TRACKMOUSE "False"
98 #define DEF_OBJECT "0"
99 static Bool do_texture;
100 static Bool do_trackmouse;
104 static XrmOptionDescRec opts[] = {
105 {"-texture", ".sballs.texture", XrmoptionNoArg, "on"},
106 {"+texture", ".sballs.texture", XrmoptionNoArg, "off"},
107 {"-trackmouse", ".sballs.trackmouse", XrmoptionNoArg, "on"},
108 {"+trackmouse", ".sballs.trackmouse", XrmoptionNoArg, "off"},
109 {"-object", ".sballs.object", XrmoptionSepArg, 0},
113 static argtype vars[] = {
114 {&do_texture, "texture", "Texture", DEF_TEXTURE, t_Bool},
115 {&do_trackmouse, "trackmouse", "TrackMouse", DEF_TRACKMOUSE, t_Bool},
116 {&object, "object", "Object", DEF_OBJECT, t_Int},
120 static OptionStruct desc[] = {
121 /*{"-count spheres", "set number of spheres"},*/
122 /*{"-cycles speed", "set ball speed value"},*/
123 {"-/+texture", "turn on/off texturing"},
124 {"-/+trackmouse", "turn on/off the tracking of the mouse"},
125 {"-object num", "number of the 3D object (0 means random)"},
128 ModeSpecOpt sballs_opts =
129 { sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc };
132 ModStruct sballs_description =
133 { "sballs", "init_sballs", "draw_sballs", "release_sballs",
134 "draw_sballs", "change_sballs", (char *) NULL, &sballs_opts,
136 delay,count,cycles,size,ncolors,sat
138 10000, 0, 10, 400, 64, 1.0, "",
139 "balls spinning like crazy in GL", 0, NULL
141 #endif /* USE_MODULES */
143 /* misc types and defines */
144 #define vinit(a,i,j,k) {\
150 typedef vec_t vec3_t[3];
154 /* the mode struct, contains all per screen variables */
156 GLint WIDTH, HEIGHT; /* display dimensions */
157 GLXContext *glx_context;
160 XImage *btexture; /* back texture image bits */
161 XImage *ftexture; /* face texture image bits */
162 GLuint backid; /* back texture id: GL world */
163 GLuint faceid; /* face texture id: GL world */
169 float radius[MAX_BALLS];
173 /* array of sballsstruct indexed by screen number */
174 static sballsstruct *sballs = (sballsstruct *) NULL;
177 static float LightAmbient[]= { 1.0f, 1.0f, 1.0f, 1.0f };
178 static float LightDiffuse[]= { 1.0f, 1.0f, 1.0f, 1.0f };
179 static float LightPosition[]= { 0.0f, 0.0f, 4.0f, 1.0f };
181 /* structure of the polyhedras */
183 const char *longname; /* long name of object */
184 const char *shortname; /* short name of object */
185 int numverts; /* number of vertices */
186 float radius; /* radius */
187 vec3_t v[MAX_BALLS];/* the vertices */
190 static Polyinfo polygons[] =
193 /* 0: objtetra - structure values for tetrahedron */
195 "tetrahedron", "tetra", /* long and short names */
196 4, /* number of vertices */
198 { /* vertices (x,y,z) */
199 /* all points must be within radius 2 of the origin */
209 /* 1: objcube - structure values for cube */
212 "hexahedron", "cube", /* long and short names */
213 8, /* number of vertices, edges, and faces */
215 { /* vertices (x,y,z) */
216 /* all points must be within radius 2 of the origin */
230 /* 2: objocta - structure values for octahedron */
233 "octahedron", "octa", /* long and short names */
234 6, /* number of vertices */
236 { /* vertices (x,y,z) */
237 /* all points must be within radius 2 of the origin */
248 /* 3: objdodec - structure values for dodecahedron */
251 "dodecahedron", "dodeca", /* long and short names */
252 20, /* number of vertices */
254 { /* vertices (x,y,z) */
255 /* all points must be within radius 2 of the origin */
256 {0.000000, 0.500000, 1.000000},
257 {0.000000, -0.500000, 1.000000},
258 {0.000000, -0.500000, -1.000000},
259 {0.000000, 0.500000, -1.000000},
260 {1.000000, 0.000000, 0.500000},
261 {-1.000000, 0.000000, 0.500000},
262 {-1.000000, 0.000000, -0.500000},
263 {1.000000, 0.000000, -0.500000},
264 {0.500000, 1.000000, 0.000000},
265 {-0.500000, 1.000000, 0.000000},
266 {-0.500000, -1.000000, 0.000000},
267 {0.500000, -1.000000, 0.000000},
268 {0.750000, 0.750000, 0.750000},
269 {-0.750000, 0.750000, 0.750000},
270 {-0.750000, -0.750000, 0.750000},
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},
279 /* 4: objicosa - structure values for icosahedron */
282 "icosahedron", "icosa", /* long and short names */
283 12, /* number of vertices */
285 { /* vertices (x,y,z) */
286 /* all points must be within radius 2 of the origin */
287 {0.00000000, 0.00000000, -0.95105650},
288 {0.00000000, 0.85065080, -0.42532537},
289 {0.80901698, 0.26286556, -0.42532537},
290 {0.50000000, -0.68819095, -0.42532537},
291 {-0.50000000, -0.68819095, -0.42532537},
292 {-0.80901698, 0.26286556, -0.42532537},
293 {0.50000000, 0.68819095, 0.42532537},
294 {0.80901698, -0.26286556, 0.42532537},
295 {0.00000000, -0.85065080, 0.42532537},
296 {-0.80901698, -0.26286556, 0.42532537},
297 {-0.50000000, 0.68819095, 0.42532537},
298 {0.00000000, 0.00000000, 0.95105650}
302 /* 5: objplane - structure values for plane */
305 "plane", "plane", /* long and short names */
306 4, /* number of vertices */
308 { /* vertices (x,y,z) */
309 /* all points must be within radius 2 of the origin */
319 /* 6: objpyr - structure values for pyramid */
322 "pyramid", "pyramid", /* long and short names */
323 5, /* number of vertices */
325 { /* vertices (x,y,z) */
326 /* all points must be within radius 1 of the origin */
337 /* 7: objstar - structure values for octahedron star (stellated octahedron?) */
339 "star", "star", /* long and short names */
340 8, /* number of vertices */
342 { /* vertices (x,y,z) */
343 /* all points must be within radius 1 of the origin */
363 *-----------------------------------------------------------------------------
364 *-----------------------------------------------------------------------------
366 *-----------------------------------------------------------------------------
367 *-----------------------------------------------------------------------------
370 static void clamp(vec3_t v)
374 for (i = 0; i < 3; i ++)
375 if (v[i] > 360 || v[i] < -360)
379 /* track the mouse in a joystick manner : not perfect but it works */
380 static void trackmouse(ModeInfo * mi)
382 sballsstruct *sb = &sballs[MI_SCREEN(mi)];
383 /* we keep static values (not per screen) for the mouse stuff: in general you have only one mouse :-> */
384 static int max[2] = { 0, 0 };
385 static int min[2] = { 0x7fffffff, 0x7fffffff }, center[2];
390 (void) XQueryPointer(MI_DISPLAY(mi), MI_WINDOW(mi),
391 &r, &c, &rx, &ry, &cx, &cy, &m);
397 center[0] = (max[0] + min[0]) / 2;
403 center[1] = (max[1] + min[1]) / 2;
405 if (fabs(center[0] - (float) cx) > 0.1 * (max[0] - min[0]))
406 sb->rot[0] -= ((center[0] - (float) cx) / (max[0] - min[0]) * 180.0f) / 200.0f;
407 if (fabs(center[1] - (float) cy) > 0.1 * (max[1] - min[1]))
408 sb->rot[1] -= ((center[1] - (float) cy) / (max[1] - min[1]) * 180.0f) / 200.0f;;
411 /* oops: can't get those buttons */
419 /* initialise textures */
420 static void inittextures(ModeInfo * mi)
422 sballsstruct *sb = &sballs[MI_SCREEN(mi)];
424 #if defined( I_HAVE_XPM )
427 glGenTextures(1, &sb->backid);
428 #ifdef HAVE_GLBINDTEXTURE
429 glBindTexture(GL_TEXTURE_2D, sb->backid);
430 #endif /* HAVE_GLBINDTEXTURE */
432 sb->btexture = xpm_to_ximage(MI_DISPLAY(mi),
436 if (!(sb->btexture)) {
437 (void) fprintf(stderr, "Error reading the background texture.\n");
438 glDeleteTextures(1, &sb->backid);
440 sb->faceid = 0; /* default textures */
445 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
447 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA,
448 sb->btexture->width, sb->btexture->height, 0,
450 /* GL_UNSIGNED_BYTE, */
451 GL_UNSIGNED_INT_8_8_8_8_REV,
453 check_gl_error("texture");
455 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
456 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
458 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
459 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
461 glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
463 glGenTextures(1, &sb->faceid);
464 #ifdef HAVE_GLBINDTEXTURE
465 glBindTexture(GL_TEXTURE_2D, sb->faceid);
466 #endif /* HAVE_GLBINDTEXTURE */
468 sb->ftexture = xpm_to_ximage(MI_DISPLAY(mi),
472 if (!(sb->ftexture)) {
473 (void) fprintf(stderr, "Error reading the face texture.\n");
474 glDeleteTextures(1, &sb->faceid);
479 glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
481 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA,
482 sb->ftexture->width, sb->ftexture->height, 0,
484 /* GL_UNSIGNED_BYTE, */
485 GL_UNSIGNED_INT_8_8_8_8_REV,
487 check_gl_error("texture");
489 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
490 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
492 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
493 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
495 glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
499 sb->faceid = 0; /* default textures */
502 #else /* !I_HAVE_XPM */
504 sb->faceid = 0; /* default textures */
506 #endif /* !I_HAVE_XPM */
509 static void drawSphere(ModeInfo * mi,int sphere_num)
511 sballsstruct *sb = &sballs[MI_SCREEN(mi)];
512 float x = polygons[object].v[sphere_num][0];
513 float y = polygons[object].v[sphere_num][1];
514 float z = polygons[object].v[sphere_num][2];
517 float radius = sb->radius[sphere_num];
518 double majorStep = (M_PI / numMajor);
519 double minorStep = (2.0 * M_PI / numMinor);
523 glTranslatef(x, y, z);
525 glColor4f(1, 1, 1, 1);
526 for (i = 0; i < numMajor; ++i)
528 double a = i * majorStep;
529 double b = a + majorStep;
530 double r0 = radius * sin(a);
531 double r1 = radius * sin(b);
532 GLfloat z0 = radius * cos(a);
533 GLfloat z1 = radius * cos(b);
535 glBegin(MI_IS_WIREFRAME(mi) ? GL_LINE_STRIP: GL_TRIANGLE_STRIP);
536 for (j = 0; j <= numMinor; ++j)
538 double c = j * minorStep;
542 glNormal3f((x * r0) / radius, (y * r0) / radius, z0 / radius);
543 glTexCoord2f(j / (GLfloat) numMinor, i / (GLfloat) numMajor);
544 glVertex3f(x * r0, y * r0, z0);
546 glNormal3f((x * r1) / radius, (y * r1) / radius, z1 / radius);
547 glTexCoord2f(j / (GLfloat) numMinor, (i + 1) / (GLfloat) numMajor);
548 glVertex3f(x * r1, y * r1, z1);
559 *-----------------------------------------------------------------------------
560 *-----------------------------------------------------------------------------
562 *-----------------------------------------------------------------------------
563 *-----------------------------------------------------------------------------
567 static void Reshape(ModeInfo * mi)
569 void reshape_sballs(ModeInfo * mi, int width, int height)
573 sballsstruct *sb = &sballs[MI_SCREEN(mi)];
574 int size = MI_SIZE(mi);
576 /* Viewport is specified size if size >= MINSIZE && size < screensize */
578 sb->WIDTH = MI_WIDTH(mi);
579 sb->HEIGHT = MI_HEIGHT(mi);
580 } else if (size < MINSIZE) {
582 sb->HEIGHT = MINSIZE;
584 sb->WIDTH = (size > MI_WIDTH(mi)) ? MI_WIDTH(mi) : size;
585 sb->HEIGHT = (size > MI_HEIGHT(mi)) ? MI_HEIGHT(mi) : size;
587 glViewport((MI_WIDTH(mi) - sb->WIDTH) / 2, (MI_HEIGHT(mi) - sb->HEIGHT) / 2, sb->WIDTH, sb->HEIGHT);
588 glMatrixMode(GL_PROJECTION);
590 gluPerspective(55.0, (float)sb->WIDTH / (float) sb->HEIGHT, 1.0, 300.0);
592 glMatrixMode(GL_MODELVIEW);
596 static void Draw(ModeInfo * mi)
598 sballsstruct *sb = &sballs[MI_SCREEN(mi)];
601 mi->polygon_count = 0;
603 if (do_trackmouse && !MI_IS_ICONIC(mi))
606 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
609 glEnable(GL_DEPTH_TEST);
612 glTranslatef (-sb->eye[0], -sb->eye[1], -sb->eye[2]);
614 /* draw background */
617 glEnable(GL_LIGHTING);
618 glEnable(GL_TEXTURE_2D);
620 #ifdef HAVE_GLBINDTEXTURE
621 glBindTexture(GL_TEXTURE_2D, sb->backid);
622 #endif /* HAVE_GLBINDTEXTURE */
628 glBegin(GL_QUAD_STRIP);
629 glNormal3f(0, 0, 1); glTexCoord2f(0,0); glVertex3f(8, 4.1, -4);
630 glNormal3f(0, 0, 1); glTexCoord2f(0,1); glVertex3f(8, -4.1, -4);
631 glNormal3f(0, 0, 1); glTexCoord2f(1,0); glVertex3f(-8, 4.1, -4);
632 glNormal3f(0, 0, 1); glTexCoord2f(1,1); glVertex3f(-8, -4.1, -4);
636 /* rotate the mouse */
637 glRotatef(sb->rot[0], 1.0f, 0.0f, 0.0f);
638 glRotatef(sb->rot[1], 0.0f, 1.0f, 0.0f);
639 glRotatef(sb->rot[2], 0.0f, 0.0f, 1.0f);
641 /* rotate the balls */
642 glRotatef(sb->rotm[0], 1.0f, 0.0f, 0.0f);
643 glRotatef(sb->rotm[1], 0.0f, 1.0f, 0.0f);
644 glRotatef(sb->rotm[2], 0.0f, 0.0f, 1.0f);
646 sb->rotm[0] += sb->speed;
647 sb->rotm[1] += -(sb->speed);
652 #ifdef HAVE_GLBINDTEXTURE
653 glBindTexture(GL_TEXTURE_2D, sb->faceid);
654 #endif /* HAVE_GLBINDTEXTURE */
656 glEnable(GL_LIGHTING);
657 for (sphere=0;sphere<spheres;sphere++)
659 drawSphere(mi,sphere);
662 glDisable(GL_TEXTURE_2D);
663 glDisable(GL_DEPTH_TEST);
664 glDisable(GL_LIGHTING);
666 /* manage framerate display */
667 if (MI_IS_FPS(mi)) do_fps (mi);
672 static void Init(ModeInfo * mi)
674 sballsstruct *sb = &sballs[MI_SCREEN(mi)];
677 /* Default settings */
678 if (MI_IS_WIREFRAME(mi))
684 sb->btexture = (XImage*) NULL;
685 sb->ftexture = (XImage*) NULL;
688 vinit(sb->eye ,0.0f, 0.0f, 6.0f);
689 vinit(sb->rot ,0.0f, 0.0f, 0.0f);
690 vinit(sb->rotm ,0.0f, 0.0f, 0.0f);
691 sb->speed = MI_CYCLES(mi);
693 /* initialise object number */
694 if ((object == 0) || (object > MAX_OBJ))
695 object = NRAND(MAX_OBJ-1)+1;
698 /* initialise sphere number */
699 spheres = MI_COUNT(mi);
700 if (MI_COUNT(mi) > polygons[object].numverts)
701 spheres = polygons[object].numverts;
702 if (MI_COUNT(mi) < 1)
703 spheres = polygons[object].numverts;
704 /* initialise sphere radius */
705 for(i=0; i < spheres;i++)
708 sb->radius[i] = ((float) LRAND() / (float) MAXRAND);
709 if (sb->radius[i] < 0.3)
711 if (sb->radius[i] > 0.7)
714 sb->radius[i] = polygons[object].radius;
718 if (MI_IS_DEBUG(mi)) {
719 (void) fprintf(stderr,
720 "%s:\n\tobject=%s\n\tspheres=%d\n\tspeed=%d\n\ttexture=%s\n",
722 polygons[object].shortname,
725 do_texture ? "on" : "off"
729 glLightfv(GL_LIGHT1, GL_AMBIENT, LightAmbient);
730 glLightfv(GL_LIGHT1, GL_DIFFUSE, LightDiffuse);
731 glLightfv(GL_LIGHT1, GL_POSITION,LightPosition);
734 glClearColor(0, 0, 0, 0);
738 *-----------------------------------------------------------------------------
739 *-----------------------------------------------------------------------------
741 *-----------------------------------------------------------------------------
742 *-----------------------------------------------------------------------------
746 *-----------------------------------------------------------------------------
747 * Initialize sballs. Called each time the window changes.
748 *-----------------------------------------------------------------------------
751 void init_sballs(ModeInfo * mi)
755 if (sballs == NULL) {
756 if ((sballs = (sballsstruct *) calloc(MI_NUM_SCREENS(mi),
757 sizeof(sballsstruct))) == NULL)
760 sb = &sballs[MI_SCREEN(mi)];
762 if ((sb->glx_context = init_GL(mi)) != NULL) {
765 Reshape(mi); /* xlock mode */
767 reshape_sballs(mi,MI_WIDTH(mi),MI_HEIGHT(mi)); /* xscreensaver mode */
769 glDrawBuffer(GL_BACK);
778 *-----------------------------------------------------------------------------
779 * Called by the mainline code periodically to update the display.
780 *-----------------------------------------------------------------------------
782 void draw_sballs(ModeInfo * mi)
784 Display *display = MI_DISPLAY(mi);
785 Window window = MI_WINDOW(mi);
790 sb = &sballs[MI_SCREEN(mi)];
792 MI_IS_DRAWN(mi) = True;
793 if (!sb->glx_context)
796 glXMakeCurrent(display, window, *(sb->glx_context));
799 Reshape(mi); /* xlock mode */
801 reshape_sballs(mi,MI_WIDTH(mi),MI_HEIGHT(mi)); /* xscreensaver mode */
805 glXSwapBuffers(display, window);
810 *-----------------------------------------------------------------------------
811 * The display is being taken away from us. Free up malloc'ed
812 * memory and X resources that we've alloc'ed. Only called
813 * once, we must zap everything for every screen.
814 *-----------------------------------------------------------------------------
817 void release_sballs(ModeInfo * mi)
821 if (sballs != NULL) {
822 for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) {
823 sballsstruct *sb = &sballs[screen];
826 glDeleteTextures(1,&sb->backid);
827 XDestroyImage(sb->btexture);
831 glDeleteTextures(1,&sb->faceid);
832 XDestroyImage(sb->ftexture);
835 (void) free((void *) sballs);
836 sballs = (sballsstruct *) NULL;
841 void change_sballs(ModeInfo * mi)
847 sb = &sballs[MI_SCREEN(mi)];
849 if (!sb->glx_context)
852 /* initialise object number */
853 if ((object == 0) || (object > MAX_OBJ))
854 object = NRAND(MAX_OBJ-1)+1;
857 /* correct sphere number */
858 spheres = MI_COUNT(mi);
859 if (MI_COUNT(mi) > polygons[object].numverts)
860 spheres = polygons[object].numverts;
861 if (MI_COUNT(mi) < 1)
862 spheres = polygons[object].numverts;
864 if (MI_IS_DEBUG(mi)) {
865 (void) fprintf(stderr,
866 "%s:\n\tobject=%s\n\tspheres=%d\n\tspeed=%d\n\ttexture=%s\n",
868 polygons[object].shortname,
871 do_texture ? "on" : "off"
874 glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(sb->glx_context));
877 #endif /* MODE_sballs */