summaryrefslogtreecommitdiffstats
path: root/hacks/glx/quasicrystal.c
diff options
context:
space:
mode:
Diffstat (limited to 'hacks/glx/quasicrystal.c')
-rw-r--r--hacks/glx/quasicrystal.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/hacks/glx/quasicrystal.c b/hacks/glx/quasicrystal.c
index b82f470..52f819e 100644
--- a/hacks/glx/quasicrystal.c
+++ b/hacks/glx/quasicrystal.c
@@ -24,7 +24,6 @@
"*wireframe: False \n" \
"*suppressRotationAnimation: True\n" \
-# define free_quasicrystal 0
# define release_quasicrystal 0
#undef countof
#define countof(x) (sizeof((x))/sizeof((*x)))
@@ -308,7 +307,7 @@ draw_quasicrystal (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);
@@ -473,6 +472,24 @@ draw_quasicrystal (ModeInfo *mi)
glXSwapBuffers(dpy, window);
}
+
+ENTRYPOINT void
+free_quasicrystal (ModeInfo *mi)
+{
+ quasicrystal_configuration *bp = &bps[MI_SCREEN(mi)];
+ int i;
+ if (!bp->glx_context) return;
+ glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *bp->glx_context);
+ for (i = 0; i < bp->count; i++) {
+ free_rotator (bp->planes[i].rot);
+ free_rotator (bp->planes[i].rot2);
+ if (bp->planes[i].texid) glDeleteTextures (1, &bp->planes[i].texid);
+ }
+ if (bp->planes) free (bp->planes);
+ if (bp->colors) free (bp->colors);
+
+}
+
XSCREENSAVER_MODULE ("QuasiCrystal", quasicrystal)
#endif /* USE_GL */