X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fgflux.c;h=1e6daed2578b16b090439049423b2659e0710ab3;hp=d38e46e82c17ec13640c1c6c51d20f2c67b7713e;hb=aa75c7476aeaa84cf3abc192b376a8b03c325213;hpb=88cfe534a698a0562e81345957a50714af1453bc diff --git a/hacks/glx/gflux.c b/hacks/glx/gflux.c index d38e46e8..1e6daed2 100644 --- a/hacks/glx/gflux.c +++ b/hacks/glx/gflux.c @@ -43,8 +43,8 @@ #define DEFAULTS "*delay: 20000\n" \ "*showFPS: False\n" \ "*mode: grab\n" \ - "*useSHM: True \n" - + "*useSHM: True \n" \ + "*suppressRotationAnimation: True\n" \ # define refresh_gflux 0 # include "xlockmore.h" /* from the xscreensaver distribution */ @@ -283,23 +283,26 @@ ENTRYPOINT void draw_gflux(ModeInfo * mi) } -/* reset the projection matrix */ -static void resetProjection(void) +/* Standard reshape function */ +ENTRYPOINT void +reshape_gflux(ModeInfo *mi, int width, int height) { + glViewport( 0, 0, width, height ); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glFrustum(-_zoom,_zoom,-0.8*_zoom,0.8*_zoom,2,6); glTranslatef(0.0,0.0,-4.0); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); -} -/* Standard reshape function */ -ENTRYPOINT void -reshape_gflux(ModeInfo *mi, int width, int height) -{ - glViewport( 0, 0, width, height ); - resetProjection(); +# ifdef HAVE_MOBILE /* Keep it the same relative size when rotated. */ + { + GLfloat h = MI_HEIGHT(mi) / (GLfloat) MI_WIDTH(mi); + int o = (int) current_device_rotation(); + if (o != 0 && o != 180 && o != -180) + glScalef (1/h, 1/h, 1/h); + } +# endif }