X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fglxfonts.h;h=46868046c3c47afb321aeba3b166183dfa401483;hb=f8cf5ac7b2f53510f80a0eaf286a25298be17bfe;hp=32bee489f9a3ac7bfdb82b2089e0be92c9313c8d;hpb=2d04c4f22466851aedb6ed0f2919d148f726b889;p=xscreensaver diff --git a/hacks/glx/glxfonts.h b/hacks/glx/glxfonts.h index 32bee489..46868046 100644 --- a/hacks/glx/glxfonts.h +++ b/hacks/glx/glxfonts.h @@ -1,4 +1,4 @@ -/* glxfonts, Copyright (c) 2001-2004 Jamie Zawinski +/* glxfonts, Copyright (c) 2001-2012 Jamie Zawinski * Loads X11 fonts for use with OpenGL. * * Permission to use, copy, modify, distribute, and sell this software and its @@ -9,12 +9,24 @@ * software for any purpose. It is provided "as is" without express or * implied warranty. * - * Compute normal vectors for arbitrary triangles. + * Loads X11 fonts for use with OpenGL. */ #ifndef __GLXFONTS_H__ #define __GLXFONTS_H__ +#ifndef HAVE_GLBITMAP +# include "texfont.h" +#endif /* !HAVE_GLBITMAP */ + +#ifdef HAVE_GLBITMAP +/* This is basically the same as glXUseXFont(). + We have our own version of it for portability. + */ +extern void xscreensaver_glXUseXFont (Display *dpy, Font font, + int first, int count, int listbase); +#endif /* HAVE_GLBITMAP */ + /* Loads the font named by the X resource "res". Returns an XFontStruct. Also converts the font to a set of GL lists and returns the first list. @@ -23,18 +35,24 @@ extern void load_font (Display *, char *resource, XFontStruct **font_ret, GLuint *dlist_ret); -/* Width of the string in pixels. */ -extern int string_width (XFontStruct *f, const char *c); +/* Bounding box of the string in pixels. + */ +extern int string_width (XFontStruct *f, const char *c, int *height_ret); /* Draws the string on the window at the given pixel position. Newlines and tab stops are honored. Any text inside [] will be rendered as a subscript. Assumes the font has been loaded as with load_font(). */ void print_gl_string (Display *dpy, +# ifdef HAVE_GLBITMAP XFontStruct *font, GLuint font_dlist, +# else /* !HAVE_GLBITMAP */ + texture_font_data *font_data, +# endif /* !HAVE_GLBITMAP */ int window_width, int window_height, GLfloat x, GLfloat y, - const char *string); + const char *string, + Bool clear_background_p); #endif /* __GLXFONTS_H__ */