summaryrefslogtreecommitdiffstats
path: root/hacks/glx/polyhedra-gl.c
diff options
context:
space:
mode:
Diffstat (limited to 'hacks/glx/polyhedra-gl.c')
-rw-r--r--hacks/glx/polyhedra-gl.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/hacks/glx/polyhedra-gl.c b/hacks/glx/polyhedra-gl.c
index 507d295..00f6bd4 100644
--- a/hacks/glx/polyhedra-gl.c
+++ b/hacks/glx/polyhedra-gl.c
@@ -24,7 +24,6 @@
"*suppressRotationAnimation: True\n" \
-# define free_polyhedra 0
# define release_polyhedra 0
#undef countof
#define countof(x) (sizeof((x))/sizeof((*x)))
@@ -581,7 +580,7 @@ draw_polyhedra (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);
if (bp->mode == 0 && do_which >= 0 && bp->change_to < 0)
;
@@ -678,6 +677,27 @@ draw_polyhedra (ModeInfo *mi)
glXSwapBuffers(dpy, window);
}
+
+ENTRYPOINT void
+free_polyhedra (ModeInfo *mi)
+{
+ polyhedra_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->npolyhedra; i++)
+ free_polyhedron (bp->polyhedra[i]);
+ if (bp->trackball) gltrackball_free (bp->trackball);
+ if (bp->rot) free_rotator (bp->rot);
+ if (bp->colors) free (bp->colors);
+ if (bp->font1_data) free_texture_font (bp->font1_data);
+ if (bp->font2_data) free_texture_font (bp->font2_data);
+ if (bp->font3_data) free_texture_font (bp->font3_data);
+ if (glIsList(bp->object_list)) glDeleteLists(bp->object_list, 1);
+}
+
XSCREENSAVER_MODULE ("Polyhedra", polyhedra)
#endif /* USE_GL */