summaryrefslogtreecommitdiffstats
path: root/hacks/glx/gears.c
diff options
context:
space:
mode:
Diffstat (limited to 'hacks/glx/gears.c')
-rw-r--r--hacks/glx/gears.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/hacks/glx/gears.c b/hacks/glx/gears.c
index 3976f2f..feaae8c 100644
--- a/hacks/glx/gears.c
+++ b/hacks/glx/gears.c
@@ -18,7 +18,6 @@
"*wireframe: False \n" \
"*suppressRotationAnimation: True\n" \
-# define free_gears 0
# define release_gears 0
#undef countof
#define countof(x) (sizeof((x))/sizeof((*x)))
@@ -827,7 +826,7 @@ draw_gears (ModeInfo *mi)
if (!bp->glx_context)
return;
- glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(bp->glx_context));
+ glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *bp->glx_context);
glShadeModel(GL_SMOOTH);
@@ -933,6 +932,24 @@ gears_handle_event (ModeInfo *mi, XEvent *event)
return False;
}
+
+ENTRYPOINT void
+free_gears (ModeInfo *mi)
+{
+ gears_configuration *bp = &bps[MI_SCREEN(mi)];
+ int i;
+ if (!bp->glx_context) return;
+ glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *bp->glx_context);
+ if (bp->rot) free_rotator (bp->rot);
+ if (bp->trackball) gltrackball_free (bp->trackball);
+ for (i = 0; i < bp->ngears; i++)
+ if (bp->gears[i])
+ free_gear (bp->gears[i]);
+ if (glIsList(bp->armature_dlist))
+ glDeleteLists (bp->armature_dlist, 1);
+
+}
+
XSCREENSAVER_MODULE ("Gears", gears)
#endif /* USE_GL */