Changeset 3692 in orxonox.OLD for orxonox/branches
- Timestamp:
- Mar 31, 2005, 2:41:20 AM (20 years ago)
- Location:
- orxonox/branches/textEngine/src/lib/graphics/font
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/textEngine/src/lib/graphics/font/glfont.cc
r3691 r3692 54 54 55 55 56 #define DEFAULT_ PTSIZE 1856 #define DEFAULT_SIZE 18 57 57 #define DEFAULT_TEXT "orxonox 1234567890" 58 #define DEFAULT_COLOR_R 256 59 #define DEFAULT_COLOR_G 256 60 #define DEFAULT_COLOR_B 256 58 61 #define NUM_COLORS 256 59 62 … … 65 68 66 69 } 70 71 67 72 GLFont::GLFont(const char* fontFile) 68 73 { … … 76 81 } 77 82 83 /** 84 \function to enable TTF_Fonts 85 */ 78 86 void GLFont::enableFonts(void) 79 87 { … … 91 99 92 100 } 101 102 /** 103 \brief function to disable TTF_fonts 104 */ 93 105 void GLFont::disableFonts(void) 94 106 { … … 168 180 } 169 181 170 void GLFont::setSize(void) 171 { 172 173 } 182 void GLFont::setSize(unsigned int fontSize) 183 { 184 this->fontSize = fontSize; 185 } 186 187 void GLFont::setColor(Uint8 r, Uint8 g, Uint8 b) 188 { 189 this->color.r = r; 190 this->color.g = g; 191 this->color.b = b; 192 } 193 194 195 196 void GLFont::createTexture(void) 197 { 198 GLfloat texcoord[4]; 199 SDL_Surface* tmpSurf = TTF_RenderText_Blended(this->font, this->text, this->color); 200 texture = loadTexture(tmpSurf, texcoord); 201 202 } 203 174 204 175 205 /** … … 242 272 243 273 } 274 275 244 276 void GLFont::renderText(const char* text, int x, int y) 245 277 { -
orxonox/branches/textEngine/src/lib/graphics/font/glfont.h
r3691 r3692 47 47 48 48 void setStyle(char* renderStyle); 49 void setSize(void); 49 void setSize(unsigned int fontSize); 50 void setColor(Uint8 r, Uint8 g, Uint8 b); 50 51 void setPosition(int x, int y); 52 53 void createTexture(void); 51 54 52 55 void renderText(void); … … 59 62 char* text; 60 63 unsigned int fontSize; 64 SDL_Color color; 61 65 62 66 // placement in openGL
Note: See TracChangeset
for help on using the changeset viewer.