X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fgltext.c;h=cc39bc928fe3e5f8bd6ea79cf4a3f9f3bb225ac5;hb=4361b69d3178d7fc98d0388f9a223af6c2651aba;hp=bc7e81bf6c27aedfb25d2f6c450b38e911713393;hpb=d5186197bc394e10a4402f7f6d23fbb14103bc50;p=xscreensaver diff --git a/hacks/glx/gltext.c b/hacks/glx/gltext.c index bc7e81bf..cc39bc92 100644 --- a/hacks/glx/gltext.c +++ b/hacks/glx/gltext.c @@ -15,6 +15,7 @@ "*usePty: False \n" \ # define refresh_text 0 +# define release_text 0 #define SMOOTH_TUBE /* whether to have smooth or faceted tubes */ #ifdef SMOOTH_TUBE @@ -125,6 +126,14 @@ reshape_text (ModeInfo *mi, int width, int height) 0.0, 0.0, 0.0, 0.0, 1.0, 0.0); +# ifdef HAVE_MOBILE /* Keep it the same relative size when rotated. */ + { + int o = (int) current_device_rotation(); + if (o != 0 && o != 180 && o != -180) + glScalef (1/h, 1/h, 1/h); + } +# endif + glClear(GL_COLOR_BUFFER_BIT); } @@ -308,20 +317,16 @@ text_handle_event (ModeInfo *mi, XEvent *event) } +static void free_text(ModeInfo * mi); + + ENTRYPOINT void init_text (ModeInfo *mi) { text_configuration *tp; int i; - if (!tps) { - tps = (text_configuration *) - calloc (MI_NUM_SCREENS(mi), sizeof (text_configuration)); - if (!tps) { - fprintf(stderr, "%s: out of memory\n", progname); - exit(1); - } - } + MI_INIT (mi, tps, free_text); tp = &tps[MI_SCREEN(mi)]; @@ -619,21 +624,11 @@ draw_text (ModeInfo *mi) } ENTRYPOINT void -release_text(ModeInfo * mi) +free_text(ModeInfo * mi) { - if (tps) - { - int screen; - for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) - { - text_configuration *tp = &tps[MI_SCREEN(mi)]; - if (tp->tc) - textclient_close (tp->tc); - } - } - (void) free(tps); - tps = 0; - FreeAllGL(mi); + text_configuration *tp = &tps[MI_SCREEN(mi)]; + if (tp->tc) + textclient_close (tp->tc); }