X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Ftangram.c;h=c250f5455ea6d7176d91fdd037c21a870f2a70c2;hp=82a1f4102e18ba143ad50942d39cff97bdde7000;hb=39809ded547bdbb08207d3e514950425215b4410;hpb=4361b69d3178d7fc98d0388f9a223af6c2651aba diff --git a/hacks/glx/tangram.c b/hacks/glx/tangram.c index 82a1f410..c250f545 100644 --- a/hacks/glx/tangram.c +++ b/hacks/glx/tangram.c @@ -22,7 +22,7 @@ "*titleFont2: -*-helvetica-medium-r-normal-*-*-120-*-*-*-*-*-*\n" \ "*titleFont3: -*-helvetica-medium-r-normal-*-*-80-*-*-*-*-*-*\n" \ -# define refresh_tangram 0 +# define free_tangram 0 # define release_tangram 0 #undef countof #define countof(x) (sizeof((x))/sizeof((*x))) @@ -779,7 +779,14 @@ static void draw_shapes(ModeInfo * mi) ENTRYPOINT void reshape_tangram(ModeInfo * mi, int w, int h) { - 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); } static void set_camera(tangram_configuration *tp) @@ -877,7 +884,7 @@ ENTRYPOINT void init_tangram(ModeInfo * mi) { tangram_configuration *tp; - MI_INIT (mi, tps, NULL); + MI_INIT (mi, tps); tp = &tps[MI_SCREEN(mi)];