00001 #ifndef __FTGLTextureFont__
00002 #define __FTGLTextureFont__
00003
00004 #include "FTFont.h"
00005 #include "FTVector.h"
00006 #include "FTGL.h"
00007
00008 class FTTextureGlyph;
00009
00010
00011
00012
00013
00014
00015
00016
00017 class FTGL_EXPORT FTGLTextureFont : public FTFont
00018 {
00019 public:
00020
00021
00022
00023
00024
00025 FTGLTextureFont( const char* fontFilePath);
00026
00027
00028
00029
00030
00031
00032
00033 FTGLTextureFont( const unsigned char *pBufferBytes, size_t bufferSizeInBytes);
00034
00035
00036
00037
00038 virtual ~FTGLTextureFont();
00039
00040
00041
00042
00043
00044
00045
00046
00047 virtual bool FaceSize( const unsigned int size, const unsigned int res = 72);
00048
00049
00050
00051
00052 virtual void PreRender();
00053
00054
00055
00056
00057 virtual void PostRender();
00058
00059 private:
00060
00061
00062
00063
00064
00065
00066 inline virtual FTGlyph* MakeGlyph( unsigned int glyphIndex);
00067
00068
00069
00070
00071
00072
00073
00074 inline void CalculateTextureSize();
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086 inline GLuint CreateTexture();
00087
00088
00089
00090
00091 GLsizei maximumGLTextureSize;
00092
00093
00094
00095
00096 GLsizei textureWidth;
00097
00098
00099
00100
00101 GLsizei textureHeight;
00102
00103
00104
00105
00106 FTVector<GLuint> textureIDList;
00107
00108
00109
00110
00111 int glyphHeight;
00112
00113
00114
00115
00116 int glyphWidth;
00117
00118
00119
00120
00121
00122 unsigned int padding;
00123
00124
00125
00126
00127 unsigned int numGlyphs;
00128
00129
00130
00131 unsigned int remGlyphs;
00132
00133
00134
00135 int xOffset;
00136
00137
00138
00139 int yOffset;
00140
00141 };
00142
00143
00144 #endif // __FTGLTextureFont__
00145
00146