X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fstonerview.c;h=6ce58bb05595c1044967fe5fcef7eb275ccc1966;hp=7e150b3963bf84a15f53b9611b7a79c933d4517b;hb=4361b69d3178d7fc98d0388f9a223af6c2651aba;hpb=d6b0217f2417bd19187f0ebc389d6c5c2233b11c diff --git a/hacks/glx/stonerview.c b/hacks/glx/stonerview.c index 7e150b39..6ce58bb0 100644 --- a/hacks/glx/stonerview.c +++ b/hacks/glx/stonerview.c @@ -25,6 +25,7 @@ "*wireframe: False \n" # define refresh_stonerview 0 +# define release_stonerview 0 #undef countof #define countof(x) (sizeof((x))/sizeof((*x))) @@ -76,19 +77,16 @@ reshape_stonerview (ModeInfo *mi, int width, int height) } +static void +free_stonerview (ModeInfo *mi); + + ENTRYPOINT void init_stonerview (ModeInfo *mi) { stonerview_configuration *bp; - if (!bps) { - bps = (stonerview_configuration *) - calloc (MI_NUM_SCREENS(mi), sizeof (stonerview_configuration)); - if (!bps) { - fprintf(stderr, "%s: out of memory\n", progname); - exit(1); - } - } + MI_INIT (mi, bps, free_stonerview); bp = &bps[MI_SCREEN(mi)]; @@ -135,20 +133,12 @@ draw_stonerview (ModeInfo *mi) glXSwapBuffers(MI_DISPLAY (mi), MI_WINDOW(mi)); } -ENTRYPOINT void -release_stonerview (ModeInfo *mi) +static void +free_stonerview (ModeInfo *mi) { - if (bps) { - int screen; - for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) { - stonerview_configuration *bp = &bps[screen]; - if (bp->st) - stonerview_win_release (bp->st); - } - free (bps); - bps = 0; - } - FreeAllGL(mi); + stonerview_configuration *bp = &bps[MI_SCREEN(mi)]; + if (bp->st) + stonerview_win_release (bp->st); } ENTRYPOINT Bool