Changeset 3767 in orxonox.OLD for orxonox/branches/textEngine/src/lib/graphics/font/text_engine.h
- Timestamp:
- Apr 9, 2005, 4:52:22 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/textEngine/src/lib/graphics/font/text_engine.h
r3766 r3767 8 8 9 9 for more information see the specific classes. 10 11 !! IMPORTANT !! When using ttf fonts clear the license issues prior to 12 adding them to orxonox. This is really important, because we do not want 13 to offend anyone. 10 14 */ 11 15 … … 28 32 #define FONT_DEFAULT_SIZE 50 //!< default size of the Text 29 33 #define FONT_DEFAULT_TEXT "orxonox 1234567890" //!< some default text to display 30 #define FONT_DEFAULT_COLOR_R 25 6//!< the default red part (color) of the text31 #define FONT_DEFAULT_COLOR_G 25 6//!< the default red green (color) of the text32 #define FONT_DEFAULT_COLOR_B 25 6//!< the default red blue (color) of the text34 #define FONT_DEFAULT_COLOR_R 255 //!< the default red part (color) of the text 35 #define FONT_DEFAULT_COLOR_G 255 //!< the default red green (color) of the text 36 #define FONT_DEFAULT_COLOR_B 255 //!< the default red blue (color) of the text 33 37 #define FONT_NUM_COLORS 256 //!< The number of colors. 34 38 … … 77 81 78 82 // OpenGL-specific 79 // TexCoord texCoord; 83 // TexCoord texCoord; //!< A Texture Coordinate for this glyph. 80 84 GLuint displayList; //!< DiplayList to render this Glyph. 81 85 }; 82 86 83 //! A class to handle a Font 87 //! Represents one textElement. 88 class Text 89 { 90 public: 91 int type; //!< The type of this Font. 92 char* text; //!< The text to display 93 SDL_Color color; //!< The color of the font. 94 // placement in openGL 95 GLuint texture; //!< A GL-texture to hold the text 96 TexCoord texCoord; //!< Texture-coordinates \todo fix this to have a struct 97 SDL_Rect textPosSize; //!< An SDL-Rectangle representing the position and size of the Text on the screen. 98 int renderStyle; //!< The Renderstyle 99 100 PNode* bindNode; //!< A node the Text is bind to. (if NULL thr node will not be bound to anything.) 101 }; 102 103 104 //! A class to handle a Font of a certain ttf-File, Size and Color. 84 105 class Font 85 106 { 86 107 public: 87 Font(const char* fontFile); 108 Font(const char* fontFile, unsigned int fontSize = FONT_DEFAULT_SIZE, 109 Uint8 r = FONT_DEFAULT_COLOR_R, Uint8 g = FONT_DEFAULT_COLOR_G, Uint8 b = FONT_DEFAULT_COLOR_B); 88 110 virtual ~Font(); 89 111 … … 115 137 GLuint fastTextureID; //!< The fast textureID. 116 138 117 //! Represents one textElement.118 struct Text119 {120 int type; //!< The type of this Font.121 char* text; //!< The text to display122 SDL_Color color; //!< The color of the font.123 // placement in openGL124 GLuint texture; //!< A GL-texture to hold the text125 TexCoord texCoord; //!< Texture-coordinates \todo fix this to have a struct126 SDL_Rect textPosSize; //!< An SDL-Rectangle representing the position and size of the Text on the screen.127 int renderStyle; //!< The Renderstyle128 129 PNode* bindNode; //!< A node the Text is bind to. (if NULL thr node will not be bound to anything.)130 };131 139 tList<Text>* textList; 132 140 Text* currentText; 133 141 134 bool init(const char* fontFile, unsigned int fontSize = FONT_DEFAULT_SIZE);135 142 int getMaxHeight(void); 136 143 int getMaxAscent(void);
Note: See TracChangeset
for help on using the changeset viewer.