X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fsuperquadrics.c;h=3c0833543deedcefd181a6f37b100540316a65cb;hp=5ab7ef5109353ba4ac6eab5b389e18079b8f60c2;hb=39809ded547bdbb08207d3e514950425215b4410;hpb=4361b69d3178d7fc98d0388f9a223af6c2651aba diff --git a/hacks/glx/superquadrics.c b/hacks/glx/superquadrics.c index 5ab7ef51..3c083354 100644 --- a/hacks/glx/superquadrics.c +++ b/hacks/glx/superquadrics.c @@ -78,6 +78,7 @@ static const char sccsid[] = "@(#)superquadrics.c 4.07 97/11/24 xlockmore"; "*wireframe: False \n" \ "*suppressRotationAnimation: True\n" \ +# define free_superquadrics 0 # define release_superquadrics 0 # define superquadrics_handle_event 0 # include "xlockmore.h" /* from the xscreensaver distribution */ @@ -618,7 +619,14 @@ ReshapeSuperquadrics(int w, int h) glViewport(0, 0, w, h); } #else - glViewport(0, 0, w, h); + int y = 0; + + if (w > h * 5) { /* tiny window: show middle */ + h = w; + y = -h/2; + } + + glViewport(0, y, w, h); #endif glMatrixMode(GL_PROJECTION); @@ -727,7 +735,7 @@ init_superquadrics(ModeInfo * mi) superquadricsstruct *sp; - MI_INIT (mi, superquadrics, NULL); + MI_INIT (mi, superquadrics); sp = &superquadrics[screen]; sp->mono = (MI_IS_MONO(mi) ? 1 : 0); @@ -777,11 +785,13 @@ draw_superquadrics(ModeInfo * mi) glXSwapBuffers(display, window); } +#ifndef STANDALONE ENTRYPOINT void refresh_superquadrics(ModeInfo * mi) { /* Nothing happens here */ } +#endif ENTRYPOINT void reshape_superquadrics(ModeInfo * mi, int width, int height)