1 /* -*- Mode: C; tab-width: 4 -*- */
2 /* sproingies.c - 3D sproingies */
5 static const char sccsid[] = "@(#)sproingies.c 4.04 97/07/28 xlockmore";
9 * sproingies.c - Copyright 1996 by Ed Mackey, freely distributable.
11 * Permission to use, copy, modify, and distribute this software and its
12 * documentation for any purpose and without fee is hereby granted,
13 * provided that the above copyright notice appear in all copies and that
14 * both that copyright notice and this permission notice appear in
15 * supporting documentation.
17 * This file is provided AS IS with no warranties of any kind. The author
18 * shall have no liability with respect to the infringement of copyrights,
19 * trade secrets or any patents by this file or any part thereof. In no
20 * event will the author be liable for any lost revenue or profits or
21 * other special, indirect and consequential damages.
29 #endif /* HAVE_CONFIG_H */
32 # include "xlockmoreI.h" /* from the xscreensaver distribution */
33 #else /* !STANDALONE */
34 # include "xlock.h" /* from the xlockmore distribution */
35 #endif /* !STANDALONE */
44 #include "sproingies.h"
46 #define MAXSPROING 100
47 #define TARGET_COUNT 40
49 #define NO_FRAME (-10)
50 #define RESET_SPROINGIE_LIFE (-30 + myrand(28))
51 #define NEW_SPROINGIE_LIFE (40 + myrand(200))
58 * The sproingies have six "real" frames, (s1_1 to s1_6) that show a
59 * sproingie jumping off a block, headed down and to the right.
60 * The frames are numbered from 0 (FIRST_FRAME) to 5 (LAST_FRAME).
62 * There are other frame numbers for special cases (e.g. BOOM_FRAME).
64 struct sPosColor { /* Position and color of the sproingie */
65 int x, y, z; /* Position */
66 int frame; /* Current frame (0-5) */
67 int life; /* Life points */
68 GLfloat r, g, b; /* Color RGB */
69 int direction; /* Direction of next hop (left or right) */
73 int rotx, roty, dist, wireframe, flatshade, groundlevel,
75 int sframe, target_rx, target_ry, target_dist, target_count;
76 const struct gllist *sproingies[6];
77 const struct gllist *SproingieBoom;
79 struct sPosColor *positions;
82 static sp_instance *si_list = NULL;
83 static int active_screens = 0;
85 extern const struct gllist *s1_1;
86 extern const struct gllist *s1_2;
87 extern const struct gllist *s1_3;
88 extern const struct gllist *s1_4;
89 extern const struct gllist *s1_5;
90 extern const struct gllist *s1_6;
91 extern const struct gllist *s1_b;
96 return ((int) (((float) range) * LRAND() / (MAXRAND)));
99 static int smart_sproingies = 0;
102 build_TopsSides(int wireframe)
105 GLfloat mat_color[4] =
106 {0.0, 0.0, 0.0, 1.0};
108 dl_num = glGenLists(2);
110 return (0); /* 0 means out of display lists. */
113 glNewList(dl_num, GL_COMPILE);
114 mat_color[0] = 0.392157;
115 mat_color[1] = 0.784314;
116 mat_color[2] = 0.941176;
118 glColor3fv(mat_color);
120 glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, mat_color);
125 glNewList(dl_num + 1, GL_COMPILE);
127 glColor3fv(mat_color);
129 /* jwz: in wireframe mode, color tops and sides the same. */
130 mat_color[0] = 0.156863;
131 mat_color[1] = 0.156863;
132 mat_color[2] = 0.392157;
133 glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, mat_color);
140 LayGround(int sx, int sy, int sz, int width, int height, sp_instance * si)
143 GLenum begin_polygon;
146 begin_polygon = GL_LINE_LOOP;
148 begin_polygon = GL_POLYGON;
150 if (!si->wireframe) {
152 glCallList(si->TopsSides); /* Render the tops */
153 glNormal3f(0.0, 1.0, 0.0);
155 for (h = 0; h < height; ++h) {
159 for (w = 0; w < width; ++w) {
160 glBegin(begin_polygon);
162 glVertex3i(x, y, z - 1);
163 glVertex3i(x + 1, y, z - 1);
164 glVertex3i(x + 1, y, z);
166 glBegin(begin_polygon);
167 glVertex3i(x + 1, y - 1, z);
168 glVertex3i(x + 1, y - 1, z - 1);
169 glVertex3i(x + 2, y - 1, z - 1);
170 glVertex3i(x + 2, y - 1, z);
178 glCallList(si->TopsSides + 1); /* Render the sides */
180 glNormal3f(0.0, 0.0, 1.0);
182 for (h = 0; h < height; ++h) {
186 for (w = 0; w < width; ++w) {
187 glBegin(begin_polygon);
189 glVertex3i(x + 1, y, z);
190 glVertex3i(x + 1, y - 1, z);
191 glVertex3i(x, y - 1, z);
193 glBegin(begin_polygon);
194 glVertex3i(x + 1, y - 1, z);
195 glVertex3i(x + 2, y - 1, z);
196 glVertex3i(x + 2, y - 2, z);
197 glVertex3i(x + 1, y - 2, z);
199 * PURIFY 4.0.1 reports an unitialized memory read on the next line when using
200 * MesaGL 2.2 and -mono. This has been fixed in MesaGL 2.3 and later. */
207 /* Render the other sides */
209 glNormal3f(1.0, 0.0, 0.0);
211 for (h = 0; h < height; ++h) {
215 for (w = 0; w < width; ++w) {
216 glBegin(begin_polygon);
217 glVertex3i(x + 1, y, z);
218 glVertex3i(x + 1, y, z - 1);
219 glVertex3i(x + 1, y - 1, z - 1);
220 glVertex3i(x + 1, y - 1, z);
222 glBegin(begin_polygon);
223 glVertex3i(x + 2, y - 1, z);
224 glVertex3i(x + 2, y - 1, z - 1);
225 glVertex3i(x + 2, y - 2, z - 1);
226 glVertex3i(x + 2, y - 2, z);
235 glCallList(si->TopsSides); /* Render the tops */
237 for (h = 0; h < height; ++h) {
241 for (w = 0; w < width; ++w) {
242 glBegin(begin_polygon);
244 glVertex3i(x, y, z - 1);
245 glVertex3i(x + 1, y, z - 1);
246 glVertex3i(x + 1, y, z);
248 glBegin(begin_polygon);
249 glVertex3i(x + 1, y - 1, z);
250 glVertex3i(x + 1, y - 1, z - 1);
251 glVertex3i(x + 2, y - 1, z - 1);
252 glVertex3i(x + 2, y - 1, z);
262 AdvanceSproingie(int t, sp_instance * si)
264 int g_higher, g_back, t2;
265 struct sPosColor *thisSproingie = &(si->positions[t]);
266 struct sPosColor *S2 = &(si->positions[0]);
268 if (thisSproingie->life > 0) {
269 if ((++(thisSproingie->frame)) > LAST_FRAME) {
270 if (thisSproingie->frame >= BOOM_FRAME) {
271 if ((thisSproingie->r -= 0.08) < 0.0)
272 thisSproingie->r = 0.0;
273 if ((thisSproingie->g -= 0.08) < 0.0)
274 thisSproingie->g = 0.0;
275 if ((thisSproingie->b -= 0.08) < 0.0)
276 thisSproingie->b = 0.0;
277 if ((--(thisSproingie->life)) < 1) {
278 thisSproingie->life = RESET_SPROINGIE_LIFE;
282 thisSproingie->frame = FIRST_FRAME;
284 /* Check for collisions */
285 for (t2 = 0; t2 < si->maxsproingies; ++t2) {
286 if ((t2 != t) && (thisSproingie->x == S2->x) &&
287 (thisSproingie->y == S2->y) && (thisSproingie->z == S2->z) &&
288 (S2->life > 10) && (S2->frame < LAST_FRAME + 1)) {
290 if (thisSproingie->life > S2->life) {
294 if (thisSproingie->life > 10) {
295 thisSproingie->life = 10;
296 thisSproingie->frame = BOOM_FRAME;
297 if ((thisSproingie->r += 0.5) > 1.0)
298 thisSproingie->r = 1.0;
299 if ((thisSproingie->g += 0.5) > 1.0)
300 thisSproingie->g = 1.0;
301 if ((thisSproingie->b += 0.5) > 1.0)
302 thisSproingie->b = 1.0;
311 /* Time to disappear... */
312 if (!((thisSproingie->life == 10) &&
313 (thisSproingie->frame > FIRST_FRAME) &&
314 (thisSproingie->frame < BOOM_FRAME))) {
315 if ((--(thisSproingie->life)) < 1) {
316 thisSproingie->life = RESET_SPROINGIE_LIFE;
317 } else if (thisSproingie->life < 9) {
318 thisSproingie->frame -= 2;
320 } /* ... else wait here for frame FIRST_FRAME to come about. */
321 } else if (++(thisSproingie->life) >= 0) {
323 g_higher = -3 + myrand(5);
324 g_back = -2 + myrand(5);
326 g_higher = -2 + myrand(3);
327 g_back = -1 + myrand(3);
333 thisSproingie->x = (-g_higher - g_back);
334 thisSproingie->y = (g_higher << 1);
335 thisSproingie->z = (g_back - g_higher);
336 thisSproingie->life = NEW_SPROINGIE_LIFE;
337 thisSproingie->frame = NO_FRAME;
338 thisSproingie->r = (GLfloat) (40 + myrand(200)) / 255.0;
339 thisSproingie->g = (GLfloat) (40 + myrand(200)) / 255.0;
340 thisSproingie->b = (GLfloat) (40 + myrand(200)) / 255.0;
342 for (t2 = 0; t2 < si->maxsproingies; ++t2) {
343 if ((t2 != t) && (thisSproingie->x == S2->x) &&
344 (thisSproingie->y == S2->y) && (thisSproingie->z == S2->z) &&
345 (S2->life > 10) && (S2->frame < FIRST_FRAME)) {
346 /* If another is already on this place, wait. */
347 thisSproingie->life = -1;
355 NextSproingie(int screen)
357 sp_instance *si = &si_list[screen];
359 struct sPosColor *thisSproingie = &(si->positions[0]);
361 /* Although the sproingies cycle has six frames, the blocks cycle */
362 /* has twelve. After a full cycle (12 frames), re-center positions */
364 if (++si->sframe > 11) {
365 si->sframe = FIRST_FRAME;
366 for (t = 0; t < si->maxsproingies; ++t) {
367 thisSproingie->x -= 1;
368 thisSproingie->y += 2;
369 thisSproingie->z -= 1;
374 for (t = 0; t < si->maxsproingies; ++t) {
375 AdvanceSproingie(t, si);
378 if (si->target_count < 0) { /* track to current target */
379 if (si->target_rx < si->rotx)
381 else if (si->target_rx > si->rotx)
384 if (si->target_ry < si->roty)
386 else if (si->target_ry > si->roty)
389 ddx = (si->target_dist - si->dist) / 8;
392 else if (si->target_dist < si->dist)
394 else if (si->target_dist > si->dist)
397 if ((si->target_rx == si->rotx) && (si->target_ry == si->roty) &&
398 (si->target_dist == si->dist)) {
399 si->target_count = TARGET_COUNT;
400 if (si->target_dist <= 32)
401 si->target_count >>= 2;
403 } else if (--si->target_count < 0) { /* make up new target */
404 si->target_rx = myrand(100) - 35;
405 si->target_ry = -myrand(90);
406 si->target_dist = 32 << myrand(2); /* could be 32, 64, or 128, (previously or 256) */
408 if (si->target_dist >= si->dist) /* no duplicate distances */
409 si->target_dist <<= 1;
411 /* Otherwise just hang loose for a while here */
420 for (t = 0; t < maxsproingies; ++t) {
421 if (positions[t].life > 0)
424 (void) printf("RotX: %d, RotY: %d, Dist: %d. Targets: X %d, Y %d, D %d. Visible: %d\n",
425 rotx, roty, dist, target_rx, target_ry, target_dist, count);
433 for (t = 0; t < maxsproingies; ++t) {
437 positions[t].life = -2;
438 positions[t].frame = FIRST_FRAME;
445 if (dist < (1 << 16 << 4))
459 rotx = (rotx + 5) % 360;
465 rotx = (rotx - 5) % 360;
471 roty = (roty + 5) % 360;
477 roty = (roty - 5) % 360;
483 rotx = (rotx + 45) % 360;
489 rotx = (rotx - 45) % 360;
495 roty = (roty + 45) % 360;
501 roty = (roty - 45) % 360;
504 #endif /* __AUXFUNCS__ */
507 RenderSproingie(int t, sp_instance * si)
509 GLfloat scale, pointsize, mat_color[4] =
510 {0.0, 0.0, 0.0, 1.0};
512 GLdouble clipplane[4] =
513 {0.0, 1.0, 0.0, 0.0};
515 struct sPosColor *thisSproingie = &(si->positions[t]);
517 if (thisSproingie->life < 1)
523 mat_color[0] = thisSproingie->r;
524 mat_color[1] = thisSproingie->g;
525 mat_color[2] = thisSproingie->b;
527 glColor3fv(mat_color);
529 glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, mat_color);
533 if (thisSproingie->frame < FIRST_FRAME) {
534 glEnable(GL_CLIP_PLANE0);
535 glTranslatef((GLfloat) (thisSproingie->x),
536 (GLfloat) (thisSproingie->y) +
537 ((GLfloat) (thisSproingie->frame) / 9.0),
538 (GLfloat) (thisSproingie->z));
541 /* OpenGLES doesn't have this but it doesn't seem to matter */
542 clipplane[3] = ((GLdouble) (thisSproingie->frame) / 9.0) +
543 (si->wireframe ? 0.0 : 0.1);
544 glClipPlane(GL_CLIP_PLANE0, clipplane);
547 /** glCallList(si->sproingies[0]);*/
548 /**/ renderList(si->sproingies[0], si->wireframe);
549 glDisable(GL_CLIP_PLANE0);
550 } else if (thisSproingie->frame >= BOOM_FRAME) {
551 glTranslatef((GLfloat) (thisSproingie->x) + 0.5,
552 (GLfloat) (thisSproingie->y) + 0.5,
553 (GLfloat) (thisSproingie->z) - 0.5);
554 scale = (GLfloat) (1 << (thisSproingie->frame - BOOM_FRAME));
555 glScalef(scale, scale, scale);
556 if (!si->wireframe) {
558 glColor3fv(mat_color);
559 glDisable(GL_LIGHTING);
561 pointsize = (GLfloat) ((BOOM_FRAME + 8) - thisSproingie->frame) -
563 glPointSize((pointsize < 1.0) ? 1.0 : pointsize);
565 * PURIFY 4.0.1 reports an unitialized memory read on the next line when using
566 * MesaGL 2.2. This has been tracked to MesaGL 2.2 src/points.c line 313. */
567 /** glCallList(si->SproingieBoom);*/
568 /**/ renderList(si->SproingieBoom, si->wireframe);
570 if (!si->wireframe) {
571 glEnable(GL_LIGHTING);
574 if (thisSproingie->direction == JUMP_LEFT) {
575 /* When the sproingie jumps to the left, the frames must be */
576 /* rotated and translated */
577 glTranslatef((GLfloat) (thisSproingie->x ),
578 (GLfloat) (thisSproingie->y ),
579 (GLfloat) (thisSproingie->z - 1));
580 glRotatef((GLfloat) - 90.0, 0.0, 1.0, 0.0);
581 if (thisSproingie->frame == LAST_FRAME) {
582 thisSproingie->x -= 0;
583 thisSproingie->y -= 1;
584 thisSproingie->z += 1;
587 glTranslatef((GLfloat) (thisSproingie->x),
588 (GLfloat) (thisSproingie->y),
589 (GLfloat) (thisSproingie->z));
590 glRotatef((GLfloat) - 0.0, 0.0, 1.0, 0.0);
591 if (thisSproingie->frame == LAST_FRAME) {
592 thisSproingie->x += 1;
593 thisSproingie->y -= 1;
594 thisSproingie->z -= 0;
598 /** glCallList(si->sproingies[thisSproingie->frame]);*/
599 /**/ renderList(si->sproingies[thisSproingie->frame], si->wireframe);
601 /* Every 6 frame cycle... */
602 if (thisSproingie->frame == LAST_FRAME) {
603 /* ...check if the sproingies have gone out of the bricks */
604 if (((thisSproingie->x - thisSproingie->z == 6) &&
605 (2*thisSproingie->x + thisSproingie->y == 6)) ||
606 ((thisSproingie->z - thisSproingie->x == 5) &&
607 (2*thisSproingie->x + thisSproingie->y == -5))) {
608 /* If they have, then they die */
609 if (thisSproingie->life > 0 && thisSproingie->frame < BOOM_FRAME && thisSproingie->frame > FIRST_FRAME) {
610 thisSproingie->frame = BOOM_FRAME;
613 /* If not, they choose a direction for the next hop */
614 if (smart_sproingies) {
615 if ((thisSproingie->x - thisSproingie->z == 5) &&
616 (2*thisSproingie->x + thisSproingie->y == 5)) {
617 thisSproingie->direction = JUMP_LEFT;
618 } else if ((thisSproingie->z - thisSproingie->x == 4) &&
619 (2*thisSproingie->x + thisSproingie->y == -4)) {
620 thisSproingie->direction = JUMP_RIGHT;
622 thisSproingie->direction = myrand(2);
625 thisSproingie->direction = myrand(2);
636 ComputeGround(sp_instance * si)
638 int g_higher, g_back, g_width, g_height;
640 /* higher: x-1, y+2, z-1 */
641 /* back: x-1, y, z+1 */
643 if (si->groundlevel == 0) {
646 } else if (si->groundlevel == 1) {
654 if ((g_higher = si->dist >> 3) < 4)
658 g_height = g_higher << 1;
661 g_higher += (g_higher >> 2);
662 else if (si->rotx > 10)
663 g_higher -= (g_higher >> 2);
666 if (si->dist > 128) {
670 } else if (si->dist > 64) {
673 } else if (si->dist > 32) {
674 /* nothing special */
677 g_higher = g_back = 4;
682 /* startx, starty, startz, width, height */
683 LayGround((-g_higher - g_back), (g_higher << 1), (g_back - g_higher),
684 (g_width), (g_height), si);
688 DisplaySproingies(int screen,int pause)
690 sp_instance *si = &si_list[screen];
693 {8.0, 5.0, -2.0, 0.1};
696 glClear(GL_COLOR_BUFFER_BIT);
698 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
701 glTranslatef(0.0, 0.0, -(GLfloat) (si->dist) / 16.0); /* viewing transform */
702 glRotatef((GLfloat) si->rotx, 1.0, 0.0, 0.0);
703 glRotatef((GLfloat) si->roty, 0.0, 1.0, 0.0);
706 glLightfv(GL_LIGHT0, GL_POSITION, position);
708 #if 0 /* Show light pos */
710 glTranslatef(position[0], position[1], position[2]);
711 glColor3f(1.0, 1.0, 1.0);
712 if (!si->wireframe) {
713 glDisable(GL_LIGHTING);
715 glCallList(si->SproingieBoom);
716 if (!si->wireframe) {
717 glEnable(GL_LIGHTING);
722 glTranslatef((GLfloat) si->sframe * (-1.0 / 12.0) - 0.75,
723 (GLfloat) si->sframe * (2.0 / 12.0) - 0.5,
724 (GLfloat) si->sframe * (-1.0 / 12.0) + 0.75);
729 for (t = 0; t < si->maxsproingies; ++t) {
730 RenderSproingie(t, si);
741 NextSproingieDisplay(int screen,int pause)
743 NextSproingie(screen);
744 /* if (pause) usleep(pause); don't do this! -jwz */
745 DisplaySproingies(screen,pause);
749 ReshapeSproingies(int w, int h)
751 glViewport(0, 0, w, h);
752 glMatrixMode(GL_PROJECTION);
754 gluPerspective(65.0, (GLfloat) w / (GLfloat) h, 0.1, 2000.0); /* was 200000.0 */
755 glMatrixMode(GL_MODELVIEW);
760 CleanupSproingies(int screen)
762 sp_instance *si = &si_list[screen];
765 if (si->SproingieBoom) {
766 for (t = 0; t < 6; ++t)
767 glDeleteLists(si->sproingies[t], 1);
769 glDeleteLists(si->TopsSides, 2);
770 glDeleteLists(si->SproingieBoom, 1);
773 si->SproingieBoom = 0;
777 glDeleteLists(si->TopsSides, 2);
780 (void) free((void *) (si->positions));
781 si->positions = NULL;
783 if ((active_screens == 0) && si_list) {
784 (void) free((void *) (si_list));
790 InitSproingies(int wfmode, int grnd, int mspr, int smrtspr,
791 int screen, int numscreens, int mono)
794 {0.2, 0.2, 0.2, 1.0};
796 {10.0, 1.0, 1.0, 10.0};
797 GLfloat mat_diffuse[] =
798 {0.6, 0.6, 0.6, 1.0};
799 GLfloat mat_specular[] =
800 {0.8, 0.8, 0.8, 1.0};
801 GLfloat mat_shininess[] =
807 if (si_list == NULL) {
808 if ((si_list = (sp_instance *) calloc(numscreens,
809 sizeof (sp_instance))) == NULL)
812 si = &si_list[screen];
815 CleanupSproingies(screen);
819 if (mspr >= MAXSPROING)
820 mspr = MAXSPROING - 1;
822 smart_sproingies = smrtspr;
826 si->dist = (16 << 2);
828 si->target_count = 0;
831 si->wireframe = si->flatshade = 0;
838 si->groundlevel = grnd;
839 si->maxsproingies = mspr;
841 if (si->maxsproingies) {
842 si->positions = (struct sPosColor *) calloc(si->maxsproingies,
843 sizeof (struct sPosColor));
845 if (!(si->positions))
846 si->maxsproingies = 0;
848 for (t = 0; t < si->maxsproingies; ++t) {
849 si->positions[t].x = 0;
850 si->positions[t].y = 0;
851 si->positions[t].z = 0;
852 si->positions[t].life = (-t * ((si->maxsproingies > 19) ? 1 : 4)) - 2;
853 si->positions[t].frame = FIRST_FRAME;
854 si->positions[t].direction = myrand(2);
857 #if 0 /* Test boom */
858 si->positions[0].x = 0;
859 si->positions[0].y = 0;
860 si->positions[0].z = 0;
861 si->positions[0].life = 10;
862 si->positions[0].frame = BOOM_FRAME;
863 si->positions[0].r = 0.656863;
864 si->positions[0].g = 1.0;
865 si->positions[0].b = 0.656863;
868 if (!(si->TopsSides = build_TopsSides(si->wireframe)))
869 (void) fprintf(stderr, "build_TopsSides\n");
871 if (!(si->sproingies[0] = BuildLWO(si->wireframe, &LWO_s1_1)))
872 (void) fprintf(stderr, "BuildLWO - 1\n");
873 if (!(si->sproingies[1] = BuildLWO(si->wireframe, &LWO_s1_2)))
874 (void) fprintf(stderr, "BuildLWO - 2\n");
875 if (!(si->sproingies[2] = BuildLWO(si->wireframe, &LWO_s1_3)))
876 (void) fprintf(stderr, "BuildLWO - 3\n");
877 if (!(si->sproingies[3] = BuildLWO(si->wireframe, &LWO_s1_4)))
878 (void) fprintf(stderr, "BuildLWO - 4\n");
879 if (!(si->sproingies[4] = BuildLWO(si->wireframe, &LWO_s1_5)))
880 (void) fprintf(stderr, "BuildLWO - 5\n");
881 if (!(si->sproingies[5] = BuildLWO(si->wireframe, &LWO_s1_6)))
882 (void) fprintf(stderr, "BuildLWO - 6\n");
884 if (!(si->SproingieBoom = BuildLWO(si->wireframe, &LWO_s1_b)))
885 (void) fprintf(stderr, "BuildLWO - b\n");
887 si->sproingies[0]=s1_1;
888 si->sproingies[1]=s1_2;
889 si->sproingies[2]=s1_3;
890 si->sproingies[3]=s1_4;
891 si->sproingies[4]=s1_5;
892 si->sproingies[5]=s1_6;
893 si->SproingieBoom=s1_b;
896 glShadeModel(GL_FLAT);
897 glDisable(GL_LIGHTING);
900 glShadeModel(GL_FLAT);
904 glEnable(GL_LIGHTING);
906 glDepthFunc(GL_LEQUAL);
907 glEnable(GL_DEPTH_TEST);
909 glLightfv(GL_LIGHT0, GL_AMBIENT, ambient);
910 glLightfv(GL_LIGHT0, GL_POSITION, position);
912 glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, mat_diffuse);
913 glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, mat_specular);
914 glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, mat_shininess);
916 /* glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE); */
918 glEnable(GL_CULL_FACE);
921 /* glEnable(GL_NORMALIZE); */
927 /* End of sproingies.c */