X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fprovidence.c;h=d628845e6d567f17f7fcb7ca1f8283a0758a6645;hp=2d49bb4a956b635b8fb58de7b1b3b9751a8177a2;hb=39809ded547bdbb08207d3e514950425215b4410;hpb=4361b69d3178d7fc98d0388f9a223af6c2651aba diff --git a/hacks/glx/providence.c b/hacks/glx/providence.c index 2d49bb4a..d628845e 100644 --- a/hacks/glx/providence.c +++ b/hacks/glx/providence.c @@ -19,7 +19,7 @@ "*showFPS: False \n" \ "*wireframe: False \n" -# define refresh_providence 0 +# define free_providence 0 # define release_providence 0 #include "xlockmore.h" #else @@ -596,10 +596,17 @@ static void draw_providence_strip(ModeInfo *mi) ENTRYPOINT void reshape_providence(ModeInfo * mi, int width, int height) { - double h = (GLfloat) height / (GLfloat) width; providencestruct *mp = &providence[MI_SCREEN(mi)]; + double h = (GLfloat) height / (GLfloat) width; + int y = 0; + + if (width > height * 5) { /* tiny window: show middle */ + height = width * 3; + y = -height/2; + h = height / (GLfloat) width; + } - glViewport(0, 0, mp->WindW = (GLint) width, mp->WindH = (GLint) height); + glViewport(0, y, mp->WindW = (GLint) width, mp->WindH = (GLint) height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); @@ -660,7 +667,7 @@ ENTRYPOINT void init_providence(ModeInfo *mi) { providencestruct *mp; - MI_INIT(mi, providence, NULL); + MI_INIT(mi, providence); mp = &providence[MI_SCREEN(mi)]; mp->trackball = gltrackball_init (False);