X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fglmatrix.c;h=7683c39ffe614331adce6e5f4922259a18fc418a;hp=4782c1cc7f65ce912822f00a26e8d9caa8ae1a4f;hb=39809ded547bdbb08207d3e514950425215b4410;hpb=4361b69d3178d7fc98d0388f9a223af6c2651aba diff --git a/hacks/glx/glmatrix.c b/hacks/glx/glmatrix.c index 4782c1cc..7683c39f 100644 --- a/hacks/glx/glmatrix.c +++ b/hacks/glx/glmatrix.c @@ -20,7 +20,7 @@ "*showFPS: False \n" \ "*wireframe: False \n" \ -# define refresh_matrix 0 +# define free_matrix 0 # define release_matrix 0 #undef countof #define countof(x) (sizeof((x))/sizeof((*x))) @@ -572,8 +572,15 @@ ENTRYPOINT void reshape_matrix (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(); @@ -822,7 +829,7 @@ init_matrix (ModeInfo *mi) if (wire) do_texture = False; - MI_INIT (mi, mps, NULL); + MI_INIT (mi, mps); mp = &mps[MI_SCREEN(mi)]; mp->glx_context = init_GL(mi);