summaryrefslogtreecommitdiffstats
path: root/hacks/glx/hypnowheel.c
diff options
context:
space:
mode:
authorSimon Rettberg2019-02-18 11:55:58 +0100
committerSimon Rettberg2019-02-18 11:55:58 +0100
commitaa7530630e595b80d5db54655fd827b61edc0fd7 (patch)
tree048cb74072450c7592f254c3537ac8f252d09d73 /hacks/glx/hypnowheel.c
parentForgot one DPMS killing instance (diff)
parentUpdate to 5.42 (diff)
downloadxscreensaver-23.tar.gz
xscreensaver-23.tar.xz
xscreensaver-23.zip
Merge branch 'master' into openslxv23
Diffstat (limited to 'hacks/glx/hypnowheel.c')
-rw-r--r--hacks/glx/hypnowheel.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/hacks/glx/hypnowheel.c b/hacks/glx/hypnowheel.c
index 0602e6e..76896da 100644
--- a/hacks/glx/hypnowheel.c
+++ b/hacks/glx/hypnowheel.c
@@ -24,7 +24,6 @@
"*wireframe: False \n" \
"*suppressRotationAnimation: True\n" \
-# define free_hypnowheel 0
# define release_hypnowheel 0
#undef countof
#define countof(x) (sizeof((x))/sizeof((*x)))
@@ -243,7 +242,7 @@ draw_hypnowheel (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);
@@ -317,6 +316,22 @@ hypnowheel_handle_event (ModeInfo *mi, XEvent *event)
}
+ENTRYPOINT void
+free_hypnowheel (ModeInfo *mi)
+{
+ hypnowheel_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->colors) free (bp->colors);
+ if (bp->rot) free_rotator (bp->rot);
+ if (bp->discs) {
+ for (i = 0; i < nlayers; i++)
+ if (bp->discs[i].rot) free_rotator (bp->discs[i].rot);
+ free (bp->discs);
+ }
+}
+
XSCREENSAVER_MODULE ("Hypnowheel", hypnowheel)
#endif /* USE_GL */