X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Ffps-gl.c;h=eb6b6de5fbe4fdfb92ea7c623c7474338cbc3dfd;hb=aa75c7476aeaa84cf3abc192b376a8b03c325213;hp=17b05656135daca1fa1f03263ba45c3e8b9aa989;hpb=7edd66e6bd3209013ee059819747b10b5835635b;p=xscreensaver diff --git a/hacks/glx/fps-gl.c b/hacks/glx/fps-gl.c index 17b05656..eb6b6de5 100644 --- a/hacks/glx/fps-gl.c +++ b/hacks/glx/fps-gl.c @@ -1,4 +1,4 @@ -/* fps, Copyright (c) 2001-2014 Jamie Zawinski +/* fps, Copyright (c) 2001-2015 Jamie Zawinski * Draw a frames-per-second display (Xlib and OpenGL). * * Permission to use, copy, modify, distribute, and sell this software and its @@ -46,9 +46,11 @@ static void xlockmore_gl_fps_init (fps_state *st) { gl_fps_data *data = (gl_fps_data *) calloc (1, sizeof(*data)); + int ascent, descent; data->top_p = get_boolean_resource (st->dpy, "fpsTop", "FPSTop"); data->texfont = load_texture_font (st->dpy, "fpsFont"); - texture_string_width (data->texfont, "M", &data->line_height); + texture_string_metrics (data->texfont, "M", 0, &ascent, &descent); + data->line_height = ascent + descent; st->gl_fps_data = data; } @@ -82,16 +84,11 @@ xlockmore_gl_draw_fps (ModeInfo *mi) XWindowAttributes xgwa; int lines = 1; const char *s; - int y = st->y; XGetWindowAttributes (st->dpy, st->window, &xgwa); for (s = st->string; *s; s++) if (*s == '\n') lines++; - if (y < 0) - y = xgwa.height + y - (lines * data->line_height); - y += lines * data->line_height; - glColor3f (1, 1, 1); print_texture_label (st->dpy, data->texfont, xgwa.width, xgwa.height,