summaryrefslogtreecommitdiffstats
path: root/hacks/glx/lament.c
diff options
context:
space:
mode:
Diffstat (limited to 'hacks/glx/lament.c')
-rw-r--r--hacks/glx/lament.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/hacks/glx/lament.c b/hacks/glx/lament.c
index 97ce18b..d84a58f 100644
--- a/hacks/glx/lament.c
+++ b/hacks/glx/lament.c
@@ -32,7 +32,6 @@
"*wireframe: False \n" \
"*suppressRotationAnimation: True\n" \
-# define free_lament 0
# define release_lament 0
#include "xlockmore.h"
@@ -1768,7 +1767,7 @@ draw_lament (ModeInfo *mi)
glDrawBuffer(GL_BACK);
- glXMakeCurrent(dpy, window, *(lc->glx_context));
+ glXMakeCurrent(dpy, window, *lc->glx_context);
draw(mi);
if (mi->fps_p) do_fps (mi);
@@ -1781,6 +1780,23 @@ draw_lament (ModeInfo *mi)
animate(mi);
}
+ENTRYPOINT void
+free_lament (ModeInfo *mi)
+{
+ lament_configuration *lc = &lcs[MI_SCREEN(mi)];
+ int i;
+ if (!lc->glx_context) return;
+ glXMakeCurrent (MI_DISPLAY(mi), MI_WINDOW(mi), *lc->glx_context);
+ if (lc->states) free (lc->states);
+ if (lc->trackball) gltrackball_free (lc->trackball);
+ if (lc->rot) free_rotator (lc->rot);
+ if (lc->texture) XDestroyImage (lc->texture);
+ for (i = 0; i < countof(all_objs); i++)
+ if (glIsList(lc->dlists[i])) glDeleteLists(lc->dlists[i], 1);
+ for (i = 0; i < countof(lc->texids); i++)
+ if (lc->texids[i]) glDeleteTextures (1, &lc->texids[i]);
+}
+
XSCREENSAVER_MODULE ("Lament", lament)
#endif /* USE_GL */