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/glschool.c | |
parent | Forgot one DPMS killing instance (diff) | |
parent | Update to 5.42 (diff) | |
download | xscreensaver-23.tar.gz xscreensaver-23.tar.xz xscreensaver-23.zip |
Merge branch 'master' into openslxv23
Diffstat (limited to 'hacks/glx/glschool.c')
-rw-r--r-- | hacks/glx/glschool.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/hacks/glx/glschool.c b/hacks/glx/glschool.c index 49cfc11..6ad80a9 100644 --- a/hacks/glx/glschool.c +++ b/hacks/glx/glschool.c @@ -16,7 +16,6 @@ "*showFPS: False \n" \ "*wireframe: False \n" \ -#define free_glschool (0) #define release_glschool (0) #define glschool_handle_event (xlockmore_no_events) @@ -124,7 +123,7 @@ reshape_glschool(ModeInfo *mi, int width, int height) double aspect = (double)width/(double)height; glschool_configuration *sc = &scs[MI_SCREEN(mi)]; - glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(sc->context)); + glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *sc->context); if (sc->school != (School *)0) { glschool_setBBox(sc->school, -aspect*160, aspect*160, -130, 130, -450, -50.0); glDeleteLists(sc->bboxList, 1); @@ -187,7 +186,7 @@ draw_glschool(ModeInfo *mi) return; } - glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(sc->context)); + glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *sc->context); mi->polygon_count = 0; @@ -213,4 +212,20 @@ draw_glschool(ModeInfo *mi) glXSwapBuffers(dpy, window); } + +ENTRYPOINT void +free_glschool(ModeInfo *mi) +{ + glschool_configuration *sc = &scs[MI_SCREEN(mi)]; + + if (!sc->context) return; + glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *sc->context); + + if (sc->school) glschool_freeSchool (sc->school); + if (sc->colors) free (sc->colors); + if (glIsList(sc->bboxList)) glDeleteLists(sc->bboxList, 1); + if (glIsList(sc->goalList)) glDeleteLists(sc->goalList, 1); + if (glIsList(sc->fishList)) glDeleteLists(sc->fishList, 1); +} + XSCREENSAVER_MODULE("GLSchool", glschool) |