Changeset 5336 in orxonox.OLD for trunk/src/lib/graphics/text_engine.h
- Timestamp:
- Oct 9, 2005, 12:54:09 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/text_engine.h
r5306 r5336 21 21 22 22 #ifdef HAVE_SDL_TTF_H 23 #include "SDL_ttf.h"23 #include <SDL_ttf.h> 24 24 #else 25 #include "SDL/SDL_ttf.h"25 #include <SDL/SDL_ttf.h> 26 26 #endif 27 27 … … 46 46 #define FONT_NUM_COLORS 256 //!< number of colors. 47 47 48 #define FONT_HIGHEST_KNOWN_CHAR 128//!< The highest character known to the textEngine.48 #define FONT_HIGHEST_KNOWN_CHAR 256 //!< The highest character known to the textEngine. 49 49 50 50 #define TEXT_DEFAULT_ALIGNMENT TEXT_ALIGN_CENTER //!< default alignment … … 129 129 void debug() const; 130 130 131 // helpers. 132 static GLuint loadTexture(SDL_Surface* surface, TexCoord* texCoord); 133 static int powerOfTwo(int input); 134 131 135 private: 132 136 Text(Font* font = NULL, TEXT_RENDER_TYPE type = TEXT_RENDER_DYNAMIC); 133 137 void setFont(Font* font); 134 138 135 static GLuint loadTexture(SDL_Surface* surface, TexCoord* texCoord);136 static int powerOfTwo(int input);137 139 138 140 private: … … 163 165 Font(const char* fontFile, 164 166 unsigned int fontSize = FONT_DEFAULT_SIZE); 167 Font(char** xpmArray); 165 168 166 169 virtual ~Font(); … … 168 171 // font 169 172 bool loadFont(const char* fontFile); 173 bool loadFontFromXPMArray(char** xpmArray); 174 170 175 void setSize(unsigned int fontSize); 171 176 void setStyle(const char* renderStyle); … … 175 180 /** @returns the texture to the fast-texture */ 176 181 inline GLuint getFastTextureID() const { return fastTextureID; }; 182 /** @returns the default Font */ 183 inline static Font* getDefaultFont() { return Font::defaultFont; }; 184 185 static void initDefaultFont(); 186 static void removeDefaultFont(); 177 187 178 188 private: … … 190 200 191 201 private: 192 // general purpose 193 GLdouble projMat[16]; //!< The Projection Matrix 194 202 static Font* defaultFont; //!< a default font, that is used, if other fonts were unable to be loaded. 195 203 // information about the Font 196 204 TTF_Font* font; //!< The font we use for this.
Note: See TracChangeset
for help on using the changeset viewer.