X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fpolyhedra-gl.c;h=507d295790768be406a9086e3f4f0e7feb427589;hb=39809ded547bdbb08207d3e514950425215b4410;hp=7d8d820b448c235b953325e40b14f4d5b0387b3f;hpb=aa75c7476aeaa84cf3abc192b376a8b03c325213;p=xscreensaver diff --git a/hacks/glx/polyhedra-gl.c b/hacks/glx/polyhedra-gl.c index 7d8d820b..507d2957 100644 --- a/hacks/glx/polyhedra-gl.c +++ b/hacks/glx/polyhedra-gl.c @@ -24,7 +24,7 @@ "*suppressRotationAnimation: True\n" \ -# define refresh_polyhedra 0 +# define free_polyhedra 0 # define release_polyhedra 0 #undef countof #define countof(x) (sizeof((x))/sizeof((*x))) @@ -201,8 +201,15 @@ ENTRYPOINT void reshape_polyhedra (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(); @@ -462,14 +469,7 @@ init_polyhedra (ModeInfo *mi) wire = 0; # endif - if (!bps) { - bps = (polyhedra_configuration *) - calloc (MI_NUM_SCREENS(mi), sizeof (polyhedra_configuration)); - if (!bps) { - fprintf(stderr, "%s: out of memory\n", progname); - exit(1); - } - } + MI_INIT (mi, bps); bp = &bps[MI_SCREEN(mi)];