X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Ftangram.c;h=c084af588b586fcab6af76f1972cbd11db9ee14d;hp=8fab0493efbbf2f903d61718900dd1db5a4c3ad6;hb=aa75c7476aeaa84cf3abc192b376a8b03c325213;hpb=88cfe534a698a0562e81345957a50714af1453bc diff --git a/hacks/glx/tangram.c b/hacks/glx/tangram.c index 8fab0493..c084af58 100644 --- a/hacks/glx/tangram.c +++ b/hacks/glx/tangram.c @@ -742,6 +742,15 @@ static void draw_shapes(ModeInfo * mi) { tangram_configuration *tp = &tps[MI_SCREEN(mi)]; +# 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 (h, 1/h, 1); + } +# endif + draw_tangram_shape(tp->tsm1); draw_tangram_shape(tp->tsm2); @@ -768,23 +777,9 @@ static void draw_shapes(ModeInfo * mi) } } -static void set_perspective(void) -{ - glPushMatrix(); - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - gluPerspective(60, -1, 0.1, 50); - gluLookAt(0, 5, -5, 0, 0, 0, 0, -1, 0); - glMatrixMode(GL_MODELVIEW); - glPopMatrix(); - -} - ENTRYPOINT void reshape_tangram(ModeInfo * mi, int w, int h) { glViewport(0, 0, w, h); - set_perspective(); - glLoadIdentity(); } static void set_camera(tangram_configuration *tp)