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/cubenetic.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'hacks/glx/cubenetic.c') diff --git a/hacks/glx/cubenetic.c b/hacks/glx/cubenetic.c index cc9b0d6..0ddbb29 100644 --- a/hacks/glx/cubenetic.c +++ b/hacks/glx/cubenetic.c @@ -15,7 +15,6 @@ "*wireframe: False \n" \ "*suppressRotationAnimation: True\n" \ -# define free_cube 0 # define release_cube 0 #undef countof #define countof(x) (sizeof((x))/sizeof((*x))) @@ -530,7 +529,7 @@ draw_cube (ModeInfo *mi) return; mi->polygon_count = 0; - glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(cc->glx_context)); + glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *cc->glx_context); glShadeModel(GL_FLAT); @@ -593,6 +592,27 @@ draw_cube (ModeInfo *mi) glXSwapBuffers(dpy, window); } + +ENTRYPOINT void +free_cube (ModeInfo *mi) +{ + cube_configuration *cc = &ccs[MI_SCREEN(mi)]; + if (!cc->glx_context) return; + glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *cc->glx_context); + if (cc->waves) { + free (cc->waves->srcs); + free (cc->waves->heights); + free (cc->waves); + } + if (glIsList(cc->cube_list)) glDeleteLists(cc->cube_list, 1); + if (cc->rot) free_rotator (cc->rot); + if (cc->trackball) gltrackball_free (cc->trackball); + if (cc->texture_colors) free (cc->texture_colors); + if (cc->cube_colors) free (cc->cube_colors); + if (cc->texture) free (cc->texture); + if (cc->texture_id) glDeleteTextures (1, &cc->texture_id); +} + XSCREENSAVER_MODULE_2 ("Cubenetic", cubenetic, cube) #endif /* USE_GL */ -- cgit v1.2.3-55-g7522