X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Ftopblock.c;h=9161d38d16d6f364c1e38e2a9770b367f5277f82;hp=ddf1eb1cd113c2cb6a5cfcaf7ba2af36c1aa72cc;hb=39809ded547bdbb08207d3e514950425215b4410;hpb=4361b69d3178d7fc98d0388f9a223af6c2651aba diff --git a/hacks/glx/topblock.c b/hacks/glx/topblock.c index ddf1eb1c..9161d38d 100644 --- a/hacks/glx/topblock.c +++ b/hacks/glx/topblock.c @@ -28,7 +28,6 @@ History #include -# define refresh_topBlock 0 # define release_topBlock 0 #define DEFAULTS "*delay: 10000 \n" \ @@ -159,7 +158,14 @@ ENTRYPOINT void reshape_topBlock (ModeInfo *mi, int width, int height) { GLfloat h = (GLfloat) height / (GLfloat) width; - glViewport (0, 0, (GLint) width, (GLint) height); + int y = 0; + + if (width > height * 5) { /* tiny window: show middle */ + height = width*1.5; + y = -height*0.2; + h = height / (GLfloat) width; + } + glViewport (0, y, (GLint) width, (GLint) height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective (60.0, 1/h, 1.0, 1000.0); @@ -169,7 +175,7 @@ reshape_topBlock (ModeInfo *mi, int width, int height) } /* clean up on exit, not required ... */ -static void +ENTRYPOINT void free_topBlock(ModeInfo *mi) { topBlockSTATE *tb = &tbs[MI_SCREEN(mi)]; @@ -189,7 +195,7 @@ init_topBlock (ModeInfo *mi) topBlockSTATE *tb; int wire = MI_IS_WIREFRAME(mi); - MI_INIT (mi, tbs, free_topBlock); + MI_INIT (mi, tbs); tb = &tbs[MI_SCREEN(mi)];