1 /*
2  * FTGL - OpenGL font library
3  *
4  * Copyright (c) 2001-2004 Henry Maddocks <ftgl@opengl.geek.nz>
5  * Copyright (c) 2008 Éric Beets <ericbeets@free.fr>
6  * Copyright (c) 2008 Sam Hocevar <sam@zoy.org>
7  *
8  * Permission is hereby granted, free of charge, to any person obtaining
9  * a copy of this software and associated documentation files (the
10  * "Software"), to deal in the Software without restriction, including
11  * without limitation the rights to use, copy, modify, merge, publish,
12  * distribute, sublicense, and/or sell copies of the Software, and to
13  * permit persons to whom the Software is furnished to do so, subject to
14  * the following conditions:
15  *
16  * The above copyright notice and this permission notice shall be
17  * included in all copies or substantial portions of the Software.
18  *
19  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
23  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
25  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26  */
27 
28 #ifndef __FTINTERNALS_H__
29 #define __FTINTERNALS_H__
30 
31 #include "FTGL/ftgl.h"
32 
33 #include <stdlib.h>
34 #include <stdio.h>
35 
36 
37 // Fixes for deprecated identifiers in 2.1.5
38 #ifndef FT_OPEN_MEMORY
39     #define FT_OPEN_MEMORY (FT_Open_Flags)1
40 #endif
41 
42 #ifndef FT_RENDER_MODE_MONO
43     #define FT_RENDER_MODE_MONO ft_render_mode_mono
44 #endif
45 
46 #ifndef FT_RENDER_MODE_NORMAL
47     #define FT_RENDER_MODE_NORMAL ft_render_mode_normal
48 #endif
49 
50 
51 #ifdef WIN32
52 
53     // Under windows avoid including <windows.h> is overrated.
54     // Sure, it can be avoided and "name space pollution" can be
55     // avoided, but why? It really doesn't make that much difference
56     // these days.
57     #define  WIN32_LEAN_AND_MEAN
58     #include <windows.h>
59 
60     #ifndef __gl_h_
61         #include <GL/gl.h>
62         #include <GL/glu.h>
63     #endif
64 
65 #else
66 
67     // Non windows platforms - don't require nonsense as seen above :-)
68     #ifndef __gl_h_
69         #ifdef SDL_main
70             #include "SDL_opengl.h"
71         #elif __APPLE_CC__
72             #include <OpenGL/gl.h>
73             #include <OpenGL/glu.h>
74         #else
75             #include <GL/gl.h>
76             #if defined (__sun__) && !defined (__sparc__)
77                 #include <mesa/glu.h>
78             #else
79                 #include <GL/glu.h>
80             #endif
81         #endif
82 
83     #endif
84 
85     // Required for compatibility with glext.h style function definitions of
86     // OpenGL extensions, such as in src/osg/Point.cpp.
87     #ifndef APIENTRY
88         #define APIENTRY
89     #endif
90 #endif
91 
92 FTGL_BEGIN_C_DECLS
93 
94 typedef enum
95 {
96     GLYPH_CUSTOM,
97     GLYPH_BITMAP,
98     GLYPH_BUFFER,
99     GLYPH_PIXMAP,
100     GLYPH_OUTLINE,
101     GLYPH_POLYGON,
102     GLYPH_EXTRUDE,
103     GLYPH_TEXTURE,
104 } GlyphType;
105 
106 struct _FTGLglyph
107 {
108     FTGlyph *ptr;
109     FTGL::GlyphType type;
110 };
111 
112 typedef enum
113 {
114     FONT_CUSTOM,
115     FONT_BITMAP,
116     FONT_BUFFER,
117     FONT_PIXMAP,
118     FONT_OUTLINE,
119     FONT_POLYGON,
120     FONT_EXTRUDE,
121     FONT_TEXTURE,
122 } FontType;
123 
124 struct _FTGLfont
125 {
126     FTFont *ptr;
127     FTGL::FontType type;
128 };
129 
130 typedef enum
131 {
132     LAYOUT_SIMPLE,
133 } LayoutType;
134 
135 struct _FTGLlayout
136 {
137     FTLayout *ptr;
138     FTGLfont *font;
139     FTGL::LayoutType type;
140 };
141 
142 FTGL_END_C_DECLS
143 
144 #endif  //__FTINTERNALS_H__
145 
146