X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fquasicrystal.c;h=b82f470e847f51aa68a2de7c306ba9392dbc9967;hp=5278e6d36b62f61bf8fc2ee468ea2ae6ef0cdbb7;hb=refs%2Fheads%2Fmaster;hpb=78add6e627ee5f10e1fa6f3852602ea5066eee5a diff --git a/hacks/glx/quasicrystal.c b/hacks/glx/quasicrystal.c index 5278e6d3..a988b7a2 100644 --- a/hacks/glx/quasicrystal.c +++ b/hacks/glx/quasicrystal.c @@ -24,10 +24,7 @@ "*wireframe: False \n" \ "*suppressRotationAnimation: True\n" \ -# define free_quasicrystal 0 # define release_quasicrystal 0 -#undef countof -#define countof(x) (sizeof((x))/sizeof((*x))) #include "xlockmore.h" #include "colors.h" @@ -66,7 +63,9 @@ static XrmOptionDescRec opts[] = { { "-wander", ".wander", XrmoptionNoArg, "True" }, { "+wander", ".wander", XrmoptionNoArg, "False" }, { "-symmetry", ".symmetric", XrmoptionNoArg, "True" }, + { "-symmetric", ".symmetric", XrmoptionNoArg, "True" }, { "-no-symmetry", ".symmetric", XrmoptionNoArg, "False" }, + { "-nonsymmetric", ".symmetric", XrmoptionNoArg, "False" }, { "-speed", ".speed", XrmoptionSepArg, 0 }, { "-contrast", ".contrast", XrmoptionSepArg, 0 }, }; @@ -227,7 +226,7 @@ init_quasicrystal (ModeInfo *mi) } bp->symmetric_p = - get_boolean_resource (MI_DISPLAY (mi), "symmetry", "Symmetry"); + get_boolean_resource (MI_DISPLAY (mi), "symmetric", "Symmetric"); bp->contrast = get_float_resource (MI_DISPLAY (mi), "contrast", "Contrast"); if (bp->contrast < 0 || bp->contrast > 100) @@ -306,7 +305,7 @@ draw_quasicrystal (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); @@ -471,6 +470,24 @@ draw_quasicrystal (ModeInfo *mi) glXSwapBuffers(dpy, window); } + +ENTRYPOINT void +free_quasicrystal (ModeInfo *mi) +{ + quasicrystal_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->count; i++) { + free_rotator (bp->planes[i].rot); + free_rotator (bp->planes[i].rot2); + if (bp->planes[i].texid) glDeleteTextures (1, &bp->planes[i].texid); + } + if (bp->planes) free (bp->planes); + if (bp->colors) free (bp->colors); + +} + XSCREENSAVER_MODULE ("QuasiCrystal", quasicrystal) #endif /* USE_GL */