X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fcityflow.c;h=2b3bd4fcea33af810fb1c502d169de385e5cc9c1;hp=ae1397d6dad951d91359a9bb9a1495dce04f2698;hb=39809ded547bdbb08207d3e514950425215b4410;hpb=4361b69d3178d7fc98d0388f9a223af6c2651aba diff --git a/hacks/glx/cityflow.c b/hacks/glx/cityflow.c index ae1397d6..2b3bd4fc 100644 --- a/hacks/glx/cityflow.c +++ b/hacks/glx/cityflow.c @@ -14,7 +14,7 @@ "*showFPS: False \n" \ "*wireframe: False \n" \ -# define refresh_cube 0 +# define free_cube 0 # define release_cube 0 #undef countof #define countof(x) (sizeof((x))/sizeof((*x))) @@ -99,8 +99,15 @@ ENTRYPOINT void reshape_cube (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 * 2) { /* tiny window: show middle */ + height = width; + y = -height/2; + h = height / (GLfloat) width; + } + + glViewport (0, y, (GLint) width, (GLint) height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); @@ -290,7 +297,7 @@ init_cube (ModeInfo *mi) int i; cube_configuration *cc; - MI_INIT (mi, ccs, NULL); + MI_INIT (mi, ccs); cc = &ccs[MI_SCREEN(mi)];