projects
/
xscreensaver
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
From http://www.jwz.org/xscreensaver/xscreensaver-5.16.tar.gz
[xscreensaver]
/
hacks
/
glx
/
fps-gl.c
diff --git
a/hacks/glx/fps-gl.c
b/hacks/glx/fps-gl.c
index 67031a6fe162de45bb3626e81670515d71a0f475..070ae6fb64f31b9226d857ae7c3036f9d0fd1b3e 100644
(file)
--- a/
hacks/glx/fps-gl.c
+++ b/
hacks/glx/fps-gl.c
@@
-1,4
+1,4
@@
-/* fps, Copyright (c) 2001-201
1
Jamie Zawinski <jwz@jwz.org>
+/* fps, Copyright (c) 2001-201
2
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
* Draw a frames-per-second display (Xlib and OpenGL).
*
* Permission to use, copy, modify, distribute, and sell this software and its
@@
-16,14
+16,15
@@
#ifdef HAVE_COCOA
# include "jwxyz.h"
#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 */
#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"
#include "xlockmoreI.h"
#include "fpsI.h"
#include "glxfonts.h"
@@
-36,6
+37,8
@@
extern void check_gl_error (const char *type);
static void
xlockmore_gl_fps_init (fps_state *st)
{
static void
xlockmore_gl_fps_init (fps_state *st)
{
+#ifdef HAVE_GLBITMAP
+
XFontStruct *f = st->font;
int first = f->min_char_or_byte2;
int last = f->max_char_or_byte2;
XFontStruct *f = st->font;
int first = f->min_char_or_byte2;
int last = f->max_char_or_byte2;
@@
-47,6
+50,13
@@
xlockmore_gl_fps_init (fps_state *st)
xscreensaver_glXUseXFont (st->dpy, f->fid,
first, last-first+1, st->font_dlist + first);
check_gl_error ("xscreensaver_glXUseXFont");
xscreensaver_glXUseXFont (st->dpy, f->fid,
first, last-first+1, st->font_dlist + first);
check_gl_error ("xscreensaver_glXUseXFont");
+
+#else /* !HAVE_GLBITMAP */
+
+ clear_gl_error(); /* screw it */
+ st->gl_fps_data = load_texture_font (st->dpy, "fpsFont");
+
+#endif /* !HAVE_GLBITMAP */
}
}
@@
-91,7
+101,12
@@
xlockmore_gl_draw_fps (ModeInfo *mi)
y += lines*lh + st->font->descent;
glColor3f (1, 1, 1);
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,
+# ifdef HAVE_GLBITMAP
+ st->font, st->font_dlist,
+# else /* !HAVE_GLBITMAP */
+ st->gl_fps_data,
+# endif /* !HAVE_GLBITMAP */
xgwa.width, xgwa.height,
st->x, y, st->string, st->clear_p);
}
xgwa.width, xgwa.height,
st->x, y, st->string, st->clear_p);
}