X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fmenger.c;h=249d224013f6e5d6611580587fe3040b93b45542;hb=39809ded547bdbb08207d3e514950425215b4410;hp=e26e2d31de4afe182d9ac34861c034a7c802f0c0;hpb=aa75c7476aeaa84cf3abc192b376a8b03c325213;p=xscreensaver diff --git a/hacks/glx/menger.c b/hacks/glx/menger.c index e26e2d31..249d2240 100644 --- a/hacks/glx/menger.c +++ b/hacks/glx/menger.c @@ -56,7 +56,7 @@ "*suppressRotationAnimation: True\n" \ -# define refresh_sponge 0 +# define free_sponge 0 # define release_sponge 0 #undef countof #define countof(x) (sizeof((x))/sizeof((*x))) @@ -128,8 +128,15 @@ ENTRYPOINT void reshape_sponge (ModeInfo *mi, int width, int height) { GLfloat h = (GLfloat) height / (GLfloat) width; + int y = 0; - glViewport (0, 0, (GLint) width, (GLint) height); + if (width > height * 5) { /* tiny window: show middle */ + height = width * 9/16; + y = -height/2; + h = height / (GLfloat) width; + } + + glViewport (0, y, (GLint) width, (GLint) height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); @@ -401,14 +408,7 @@ init_sponge (ModeInfo *mi) sponge_configuration *sp; int wire = MI_IS_WIREFRAME(mi); - if (!sps) { - sps = (sponge_configuration *) - calloc (MI_NUM_SCREENS(mi), sizeof (sponge_configuration)); - if (!sps) { - fprintf(stderr, "%s: out of memory\n", progname); - exit(1); - } - } + MI_INIT (mi, sps); sp = &sps[MI_SCREEN(mi)];