summaryrefslogtreecommitdiffstats
path: root/hacks/glx/voronoi.c
diff options
context:
space:
mode:
Diffstat (limited to 'hacks/glx/voronoi.c')
-rw-r--r--hacks/glx/voronoi.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/hacks/glx/voronoi.c b/hacks/glx/voronoi.c
index 895f967..01b3ccd 100644
--- a/hacks/glx/voronoi.c
+++ b/hacks/glx/voronoi.c
@@ -13,7 +13,6 @@
"*showFPS: False \n" \
"*suppressRotationAnimation: True\n" \
-# define free_voronoi 0
# define release_voronoi 0
#undef countof
#define countof(x) (sizeof((x))/sizeof((*x)))
@@ -514,7 +513,7 @@ draw_voronoi (ModeInfo *mi)
if (!vp->glx_context)
return;
- glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(vp->glx_context));
+ glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *vp->glx_context);
glShadeModel(GL_FLAT);
glEnable(GL_POINT_SMOOTH);
@@ -538,6 +537,23 @@ draw_voronoi (ModeInfo *mi)
glXSwapBuffers(dpy, window);
}
+
+ENTRYPOINT void
+free_voronoi (ModeInfo *mi)
+{
+ voronoi_configuration *vp = &vps[MI_SCREEN(mi)];
+ node *n;
+ if (!vp->glx_context) return;
+ glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *vp->glx_context);
+ if (vp->colors) free (vp->colors);
+ n = vp->nodes;
+ while (n) {
+ node *n2 = n->next;
+ free (n);
+ n = n2;
+ }
+}
+
XSCREENSAVER_MODULE ("Voronoi", voronoi)
#endif /* USE_GL */