X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fmenger.c;h=249d224013f6e5d6611580587fe3040b93b45542;hp=c5108a28d93c4725dc618e9127f0875d52a042fc;hb=39809ded547bdbb08207d3e514950425215b4410;hpb=4361b69d3178d7fc98d0388f9a223af6c2651aba diff --git a/hacks/glx/menger.c b/hacks/glx/menger.c index c5108a28..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,7 +408,7 @@ init_sponge (ModeInfo *mi) sponge_configuration *sp; int wire = MI_IS_WIREFRAME(mi); - MI_INIT (mi, sps, NULL); + MI_INIT (mi, sps); sp = &sps[MI_SCREEN(mi)];