diff options
author | Simon Rettberg | 2019-02-18 11:55:58 +0100 |
---|---|---|
committer | Simon Rettberg | 2019-02-18 11:55:58 +0100 |
commit | aa7530630e595b80d5db54655fd827b61edc0fd7 (patch) | |
tree | 048cb74072450c7592f254c3537ac8f252d09d73 /hacks/glx/companion.c | |
parent | Forgot one DPMS killing instance (diff) | |
parent | Update to 5.42 (diff) | |
download | xscreensaver-aa7530630e595b80d5db54655fd827b61edc0fd7.tar.gz xscreensaver-aa7530630e595b80d5db54655fd827b61edc0fd7.tar.xz xscreensaver-aa7530630e595b80d5db54655fd827b61edc0fd7.zip |
Merge branch 'master' into openslxv23
Diffstat (limited to 'hacks/glx/companion.c')
-rw-r--r-- | hacks/glx/companion.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/hacks/glx/companion.c b/hacks/glx/companion.c index 3c004a5..1f518b1 100644 --- a/hacks/glx/companion.c +++ b/hacks/glx/companion.c @@ -26,7 +26,6 @@ /* #define DEBUG */ -# define free_cube 0 # define release_cube 0 #define DEF_SPEED "1.0" #define DEF_SPIN "False" @@ -548,7 +547,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); @@ -587,6 +586,23 @@ 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); + for (i = 0; i < bp->nfloaters; i++) + if (bp->floaters[i].rot) free_rotator (bp->floaters[i].rot); + for (i = 0; i < countof(all_objs)+1; i++) + if (glIsList(bp->dlists[i])) glDeleteLists(bp->dlists[i], 1); + if (bp->floaters) free (bp->floaters); + if (bp->trackball) gltrackball_free (bp->trackball); + if (bp->dlists) free (bp->dlists); +} + XSCREENSAVER_MODULE_2 ("CompanionCube", companioncube, cube) #endif /* USE_GL */ |