1 // OpenGL Font Renderer. Header file.
3 #ifndef __OGL_FONT_RENDERER_H__
4 #define __OGL_FONT_RENDERER_H__
6 #define MAX_CHARS 256 // Normal 256 ANSI characters.
8 // Data for a character.
11 int x, y; // The upper left corner of the character.
12 int w, h; // The width and height.
19 unsigned int texture; // The name of the texture for this font.
20 int texWidth, texHeight;
21 jfrchar_t chars[MAX_CHARS];
27 jfrfont_t *FR_GetFont(int id);
29 // Prepare a GDI font. Select it as the current font.
31 int FR_PrepareGDIFont(HFONT hfont);
33 int FR_PrepareGDIFont(void* hfont);
36 // Change the current font.
37 void FR_SetFont(int id);
40 int FR_TextWidth(char *text);
41 int FR_TextHeight(char *text);
43 // (x,y) is the upper left corner. Returns the length.
44 int FR_TextOut(int x, int y, char *text);
46 #endif // __OGL_FONT_RENDERER_H__