summaryrefslogtreecommitdiffstats
path: root/hacks/glx/dangerball.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/dangerball.c
parentForgot one DPMS killing instance (diff)
parentUpdate to 5.42 (diff)
downloadxscreensaver-aa7530630e595b80d5db54655fd827b61edc0fd7.tar.gz
xscreensaver-aa7530630e595b80d5db54655fd827b61edc0fd7.tar.xz
xscreensaver-aa7530630e595b80d5db54655fd827b61edc0fd7.zip
Merge branch 'master' into openslxv23
Diffstat (limited to 'hacks/glx/dangerball.c')
-rw-r--r--hacks/glx/dangerball.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/hacks/glx/dangerball.c b/hacks/glx/dangerball.c
index e40ccc5..7cb38e0 100644
--- a/hacks/glx/dangerball.c
+++ b/hacks/glx/dangerball.c
@@ -15,7 +15,6 @@
"*wireframe: False \n" \
"*suppressRotationAnimation: True\n" \
-# define free_ball 0
# define release_ball 0
#undef countof
#define countof(x) (sizeof((x))/sizeof((*x)))
@@ -294,7 +293,7 @@ draw_ball (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);
glShadeModel(GL_SMOOTH);
@@ -359,6 +358,21 @@ draw_ball (ModeInfo *mi)
glXSwapBuffers(dpy, window);
}
+
+ENTRYPOINT void
+free_ball (ModeInfo *mi)
+{
+ ball_configuration *bp = &bps[MI_SCREEN(mi)];
+ if (!bp->glx_context) return;
+ glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *bp->glx_context);
+ if (bp->colors) free (bp->colors);
+ if (bp->spikes) free (bp->spikes);
+ if (bp->rot) free_rotator (bp->rot);
+ if (bp->trackball) gltrackball_free (bp->trackball);
+ if (glIsList(bp->ball_list)) glDeleteLists(bp->ball_list, 1);
+ if (glIsList(bp->spike_list)) glDeleteLists(bp->spike_list, 1);
+}
+
XSCREENSAVER_MODULE_2 ("DangerBall", dangerball, ball)
#endif /* USE_GL */