From http://www.jwz.org/xscreensaver/xscreensaver-5.30.tar.gz
[xscreensaver] / hacks / glx / fps-gl.c
index 67031a6fe162de45bb3626e81670515d71a0f475..b94c098cf8bedc505a7947143667e04cfe149598 100644 (file)
@@ -1,4 +1,4 @@
-/* fps, Copyright (c) 2001-2011 Jamie Zawinski <jwz@jwz.org>
+/* fps, Copyright (c) 2001-2014 Jamie Zawinski <jwz@jwz.org>
  * Draw a frames-per-second display (Xlib and OpenGL).
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
 
 #ifdef HAVE_COCOA
 # include "jwxyz.h"
-# include <OpenGL/gl.h>
-# include <OpenGL/glu.h>
-# include <AGL/agl.h>
 #else /* !HAVE_COCOA -- real Xlib */
 # include <GL/glx.h>
 # include <GL/glu.h>
 #endif /* !HAVE_COCOA */
 
+#ifdef HAVE_JWZGLES
+# include "jwzgles.h"
+#endif /* HAVE_JWZGLES */
+
 #include "xlockmoreI.h"
 #include "fpsI.h"
 #include "glxfonts.h"
@@ -36,17 +37,7 @@ extern void check_gl_error (const char *type);
 static void
 xlockmore_gl_fps_init (fps_state *st)
 {
-  XFontStruct *f = st->font;
-  int first = f->min_char_or_byte2;
-  int last  = f->max_char_or_byte2;
-
-  clear_gl_error ();
-  st->font_dlist = glGenLists ((GLuint) last+1);
-  check_gl_error ("glGenLists");
-
-  xscreensaver_glXUseXFont (st->dpy, f->fid,
-                            first, last-first+1, st->font_dlist + first);
-  check_gl_error ("xscreensaver_glXUseXFont");
+  st->gl_fps_data = load_texture_font (st->dpy, "fpsFont");
 }
 
 
@@ -91,7 +82,7 @@ xlockmore_gl_draw_fps (ModeInfo *mi)
       y += lines*lh + st->font->descent;
 
       glColor3f (1, 1, 1);
-      print_gl_string (st->dpy, st->font, st->font_dlist, 
+      print_gl_string (st->dpy, st->gl_fps_data,
                        xgwa.width, xgwa.height,
                        st->x, y, st->string, st->clear_p);
     }