]> icculus.org git repositories - theoddone33/hhexen.git/blob - include/ogl_font.h
Round 4: Some minor build system housekeeping, as well as removing some depricated...
[theoddone33/hhexen.git] / include / ogl_font.h
1 // OpenGL Font Renderer. Header file.
2
3 #ifndef __OGL_FONT_RENDERER_H__
4 #define __OGL_FONT_RENDERER_H__
5
6 #define MAX_CHARS       256                     // Normal 256 ANSI characters.
7
8 // Data for a character.
9 typedef struct
10 {
11         int     x, y;                                   // The upper left corner of the character.
12         int     w, h;                                   // The width and height.
13 } jfrchar_t;
14
15 // Data for a font.
16 typedef struct
17 {
18         int                             id;
19         unsigned int    texture;        // The name of the texture for this font.
20         int                             texWidth, texHeight;
21         jfrchar_t               chars[MAX_CHARS];       
22 } jfrfont_t;
23
24
25 int FR_Init();
26 void FR_Shutdown();
27 jfrfont_t *FR_GetFont(int id);
28
29 // Prepare a GDI font. Select it as the current font.
30 #ifdef __WIN32
31 int FR_PrepareGDIFont(HFONT hfont);
32 #else
33 int FR_PrepareGDIFont(void* hfont);
34 #endif
35
36 // Change the current font.
37 void FR_SetFont(int id);
38 int FR_GetCurrent();
39
40 int FR_TextWidth(char *text);
41 int FR_TextHeight(char *text);
42
43 // (x,y) is the upper left corner. Returns the length.
44 int FR_TextOut(int x, int y, char *text);
45
46 #endif // __OGL_FONT_RENDERER_H__