00001 #ifndef __FTGLTextureFont__ 00002 #define __FTGLTextureFont__ 00003 00004 #include "FTFont.h" 00005 #include "FTGL.h" 00006 00007 class FTTextureGlyph; 00008 00009 00016 class FTGL_EXPORT FTGLTextureFont : public FTFont 00017 { 00018 public: 00024 FTGLTextureFont( const char* fontname); 00025 00032 FTGLTextureFont( const unsigned char *pBufferBytes, size_t bufferSizeInBytes); 00033 00037 virtual ~FTGLTextureFont(); 00038 00046 virtual bool FaceSize( const unsigned int size, const unsigned int res = 72); 00047 00053 virtual void Render( const char* string); 00054 00060 virtual void Render( const wchar_t* string); 00061 00062 00063 private: 00070 inline virtual FTGlyph* MakeGlyph( unsigned int glyphIndex); 00071 00078 inline void CalculateTextureSize(); 00079 00090 inline GLuint CreateTexture(); 00091 00095 GLsizei maxTextSize; 00096 00100 GLsizei textureWidth; 00101 00105 GLsizei textureHeight; 00106 00110 GLuint glTextureID[128]; 00111 00115 unsigned int numTextures; 00116 00120 int glyphHeight; 00121 00125 int glyphWidth; 00126 00131 unsigned int padding; 00132 00136 unsigned int numGlyphs; 00137 00140 unsigned int remGlyphs; 00141 00144 int xOffset; 00145 00148 int yOffset; 00149 00150 }; 00151 00152 00153 #endif // __FTGLTextureFont__ 00154 00155