RELEASE/1.1RELEASE/1.2debug-cidebug-ci-sanitisersstereowalls-datawalls-data-hanging-as-warning
Line | |
---|
1 | |
---|
2 | /* Copyright (c) Mark J. Kilgard, 1997. */ |
---|
3 | |
---|
4 | /* This program is freely distributable without licensing fees and is |
---|
5 | provided without guarantee or warrantee expressed or implied. This |
---|
6 | program is -not- in the public domain. */ |
---|
7 | |
---|
8 | #ifndef __TEXFONT_H__ |
---|
9 | #define __TEXFONT_H__ |
---|
10 | |
---|
11 | #ifdef __APPLE_CC__ |
---|
12 | #include <OpenGL/gl.h> |
---|
13 | #else |
---|
14 | #include <GL/gl.h> |
---|
15 | #endif |
---|
16 | |
---|
17 | #define TXF_FORMAT_BYTE 0 |
---|
18 | #define TXF_FORMAT_BITMAP 1 |
---|
19 | |
---|
20 | typedef struct { |
---|
21 | unsigned short c; /* Potentially support 16-bit glyphs. */ |
---|
22 | unsigned char width; |
---|
23 | unsigned char height; |
---|
24 | signed char xoffset; |
---|
25 | signed char yoffset; |
---|
26 | signed char advance; |
---|
27 | char dummy; /* Space holder for alignment reasons. */ |
---|
28 | short x; |
---|
29 | short y; |
---|
30 | } TexGlyphInfo; |
---|
31 | |
---|
32 | typedef struct { |
---|
33 | GLfloat t0[2]; |
---|
34 | GLshort v0[2]; |
---|
35 | GLfloat t1[2]; |
---|
36 | GLshort v1[2]; |
---|
37 | GLfloat t2[2]; |
---|
38 | GLshort v2[2]; |
---|
39 | GLfloat t3[2]; |
---|
40 | GLshort v3[2]; |
---|
41 | GLfloat advance; |
---|
42 | } TexGlyphVertexInfo; |
---|
43 | |
---|
44 | typedef struct { |
---|
45 | GLuint texobj; |
---|
46 | int tex_width; |
---|
47 | int tex_height; |
---|
48 | int max_ascent; |
---|
49 | int max_descent; |
---|
50 | int num_glyphs; |
---|
51 | int min_glyph; |
---|
52 | int range; |
---|
53 | unsigned char *teximage; |
---|
54 | TexGlyphInfo *tgi; |
---|
55 | TexGlyphVertexInfo *tgvi; |
---|
56 | TexGlyphVertexInfo **lut; |
---|
57 | } TexFont; |
---|
58 | |
---|
59 | extern char *txfErrorString(void); |
---|
60 | |
---|
61 | extern TexFont *txfLoadFont( |
---|
62 | char *filename); |
---|
63 | |
---|
64 | extern void txfUnloadFont( |
---|
65 | TexFont * txf); |
---|
66 | |
---|
67 | extern GLuint txfEstablishTexture( |
---|
68 | TexFont * txf, |
---|
69 | GLuint texobj, |
---|
70 | GLboolean setupMipmaps); |
---|
71 | |
---|
72 | extern void txfBindFontTexture( |
---|
73 | TexFont * txf); |
---|
74 | |
---|
75 | extern void txfGetStringMetrics( |
---|
76 | TexFont * txf, |
---|
77 | char *string, |
---|
78 | int len, |
---|
79 | int *width, |
---|
80 | int *max_ascent, |
---|
81 | int *max_descent); |
---|
82 | |
---|
83 | extern void txfRenderGlyph( |
---|
84 | TexFont * txf, |
---|
85 | int c); |
---|
86 | |
---|
87 | extern void txfRenderString( |
---|
88 | TexFont * txf, |
---|
89 | char *string, |
---|
90 | int len); |
---|
91 | |
---|
92 | extern void txfRenderFancyString( |
---|
93 | TexFont * txf, |
---|
94 | char *string, |
---|
95 | int len); |
---|
96 | |
---|
97 | #endif /* __TEXFONT_H__ */ |
---|
Note: See
TracBrowser
for help on using the repository browser.