summaryrefslogtreecommitdiffstats
path: root/hacks/glx/moebiusgears.c
diff options
context:
space:
mode:
Diffstat (limited to 'hacks/glx/moebiusgears.c')
-rw-r--r--hacks/glx/moebiusgears.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/hacks/glx/moebiusgears.c b/hacks/glx/moebiusgears.c
index 0f058b8..fdcd4e0 100644
--- a/hacks/glx/moebiusgears.c
+++ b/hacks/glx/moebiusgears.c
@@ -15,7 +15,6 @@
"*wireframe: False \n" \
"*suppressRotationAnimation: True\n" \
-# define free_mgears 0
# define release_mgears 0
#undef countof
#define countof(x) (sizeof((x))/sizeof((*x)))
@@ -344,7 +343,7 @@ draw_mgears (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);
@@ -432,6 +431,18 @@ draw_mgears (ModeInfo *mi)
glXSwapBuffers(dpy, window);
}
+
+ENTRYPOINT void
+free_mgears (ModeInfo *mi)
+{
+ mgears_configuration *bp = &bps[MI_SCREEN(mi)];
+ if (!bp->glx_context) return;
+ glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *bp->glx_context);
+ if (bp->gears) free (bp->gears);
+ if (bp->rot) free_rotator (bp->rot);
+ if (bp->trackball) gltrackball_free (bp->trackball);
+}
+
XSCREENSAVER_MODULE_2 ("MoebiusGears", moebiusgears, mgears)
#endif /* USE_GL */