X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fglmatrix.c;h=7683c39ffe614331adce6e5f4922259a18fc418a;hb=39809ded547bdbb08207d3e514950425215b4410;hp=1975182bb336871a7cf5a8149f5ce9b191ff0c11;hpb=f8cf5ac7b2f53510f80a0eaf286a25298be17bfe;p=xscreensaver diff --git a/hacks/glx/glmatrix.c b/hacks/glx/glmatrix.c index 1975182b..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(); @@ -632,6 +639,10 @@ bigendian (void) If this hack ever grows into something that displays full Latin1 text, well then, Something Else Will Need To Be Done. + + Since currently GLMatrix does not run textclient / xscreensaver-text, + it's not an issue. (XMatrix does that.) + */ static void spank_image (matrix_configuration *mp, XImage *xi) @@ -818,14 +829,7 @@ init_matrix (ModeInfo *mi) if (wire) do_texture = False; - if (!mps) { - mps = (matrix_configuration *) - calloc (MI_NUM_SCREENS(mi), sizeof (matrix_configuration)); - if (!mps) { - fprintf(stderr, "%s: out of memory\n", progname); - exit(1); - } - } + MI_INIT (mi, mps); mp = &mps[MI_SCREEN(mi)]; mp->glx_context = init_GL(mi);