Changeset 3691 in orxonox.OLD for orxonox/branches/textEngine/src/lib/graphics/font/glfont.h
- Timestamp:
- Mar 31, 2005, 2:14:02 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/textEngine/src/lib/graphics/font/glfont.h
r3682 r3691 8 8 9 9 #include "glincl.h" 10 #include "SDL_ttf.h" 11 12 13 //! A struct for handling glyphs 14 struct glyph 15 { 16 Uint16 character; 17 int minX; 18 int maxX; 19 int minY; 20 int maxY; 21 int width; 22 int height; 23 int bearingX; 24 int bearingY; 25 int advance; 26 }; 27 10 28 11 29 class GLFont 12 30 { 31 32 private: 33 34 35 13 36 public: 14 37 GLFont(); 15 38 GLFont(const char* fontFile); 16 ~GLFont(); 17 39 virtual ~GLFont(); 40 41 static void enableFonts(void); 42 static void disableFonts(void); 18 43 19 44 … … 21 46 void setText(const char* text); 22 47 23 void setStyle(char* style);48 void setStyle(char* renderStyle); 24 49 void setSize(void); 25 50 void setPosition(int x, int y); … … 29 54 30 55 private: 56 // information about the Font 57 TTF_Font* font; 31 58 char* fontFile; 32 59 char* text; 60 unsigned int fontSize; 61 62 // placement in openGL 33 63 GLuint texture; 34 64 int positionX; … … 39 69 40 70 bool init(const char* fontFile); 41 bool loadTexture(); 42 static int powerOfTwo(int input); 71 int getMaxHeight(void); 72 int getMaxAscent(void); 73 int getMaxDescent(void); 74 glyph getGlyphMetrics(Uint16 character); 43 75 44 76 static bool ttfInitialized; … … 47 79 void leave2DMode(void); 48 80 81 static bool checkVersion(void); 82 49 83 GLuint loadTexture(SDL_Surface* surface, GLfloat* texcoord); 50 84 51 static int power_of_two(int input); 85 static int powerOfTwo(int input); 86 87 void debug(void); 52 88 53 89 };
Note: See TracChangeset
for help on using the changeset viewer.