From ae69a754244c4e475c8d2591772ca8e005071d83 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 18 Feb 2019 11:55:41 +0100 Subject: Update to 5.42 --- hacks/glx/cubestorm.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'hacks/glx/cubestorm.c') diff --git a/hacks/glx/cubestorm.c b/hacks/glx/cubestorm.c index cf973c9..afa1797 100644 --- a/hacks/glx/cubestorm.c +++ b/hacks/glx/cubestorm.c @@ -17,7 +17,6 @@ "*suppressRotationAnimation: True\n" \ -# define free_cube 0 # define release_cube 0 #undef countof #define countof(x) (sizeof((x))/sizeof((*x))) @@ -391,7 +390,7 @@ draw_cube (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); glShadeModel(GL_SMOOTH); @@ -464,6 +463,25 @@ draw_cube (ModeInfo *mi) glXSwapBuffers(dpy, window); } + +ENTRYPOINT void +free_cube (ModeInfo *mi) +{ + cube_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->subcubes) { + for (i = 0; i < MI_COUNT(mi); i++) + free_rotator (bp->subcubes[i].rot); + free (bp->subcubes); + } + if (bp->hist) free (bp->hist); + if (bp->trackball) gltrackball_free (bp->trackball); + if (bp->colors) free (bp->colors); + +} + XSCREENSAVER_MODULE_2 ("CubeStorm", cubestorm, cube) #endif /* USE_GL */ -- cgit v1.2.3-55-g7522