summaryrefslogtreecommitdiffstats
path: root/hacks/glx/cubestorm.c
diff options
context:
space:
mode:
Diffstat (limited to 'hacks/glx/cubestorm.c')
-rw-r--r--hacks/glx/cubestorm.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/hacks/glx/cubestorm.c b/hacks/glx/cubestorm.c
index cf973c9..afa1797 100644
--- a/hacks/glx/cubestorm.c
+++ b/hacks/glx/cubestorm.c
@@ -17,7 +17,6 @@
"*suppressRotationAnimation: True\n" \
-# define free_cube 0
# define release_cube 0
#undef countof
#define countof(x) (sizeof((x))/sizeof((*x)))
@@ -391,7 +390,7 @@ draw_cube (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);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glShadeModel(GL_SMOOTH);
@@ -464,6 +463,25 @@ draw_cube (ModeInfo *mi)
glXSwapBuffers(dpy, window);
}
+
+ENTRYPOINT void
+free_cube (ModeInfo *mi)
+{
+ cube_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->subcubes) {
+ for (i = 0; i < MI_COUNT(mi); i++)
+ free_rotator (bp->subcubes[i].rot);
+ free (bp->subcubes);
+ }
+ if (bp->hist) free (bp->hist);
+ if (bp->trackball) gltrackball_free (bp->trackball);
+ if (bp->colors) free (bp->colors);
+
+}
+
XSCREENSAVER_MODULE_2 ("CubeStorm", cubestorm, cube)
#endif /* USE_GL */