Changeset 8448 in orxonox.OLD for trunk/src/lib/graphics
- Timestamp:
- Jun 15, 2006, 12:48:26 PM (19 years ago)
- Location:
- trunk/src/lib/graphics
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/importer/material.h
r8376 r8448 38 38 39 39 void setDiffuse (float r, float g, float b); 40 void setDiffuseColor(const Color& diffuseColor) { this->diffuse = diffuseColor; }; 40 41 void setAmbient (float r, float g, float b); 41 42 void setSpecular (float r, float g, float b); -
trunk/src/lib/graphics/text_engine/multi_line_text.cc
r8059 r8448 76 76 glActiveTexture(GL_TEXTURE0); 77 77 78 glColor4f (this->getColor().x, this->getColor().y, this->getColor().z, this->getBlending());78 glColor4fv(&this->getColor()[0]); 79 79 glEnable(GL_BLEND); 80 80 glEnable(GL_TEXTURE_2D); 81 glBlendFunc(GL_SRC_ALPHA, GL_ONE );81 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 82 82 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, GL_MODULATE ); 83 83 -
trunk/src/lib/graphics/text_engine/text.cc
r8037 r8448 37 37 this->size = textSize; 38 38 this->setSizeY2D(size); 39 this->blending = TEXT_DEFAULT_BLENDING;40 39 this->color = TEXT_DEFAULT_COLOR; 41 40 … … 73 72 this->size == text.size && 74 73 this->font == text.font && 75 this->color == text.color && 76 this->blending == text.blending); 74 this->color == text.color); 77 75 } 78 76 … … 95 93 { 96 94 this->size = text.size; 97 this->blending = text.blending;98 95 this->color = text.color; 99 96 this->setAlignment(text.getAlignment()); … … 224 221 // drawing this Text. 225 222 // setting the Blending effects 226 glColor4f (this->color.x, this->color.y, this->color.z, this->blending);223 glColor4fv(&this->color[0]); 227 224 228 225 … … 231 228 glEnable(GL_BLEND); 232 229 glEnable(GL_TEXTURE_2D); 233 glBlendFunc(GL_SRC_ALPHA, GL_ONE );230 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 234 231 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, GL_MODULATE ); 235 232 … … 285 282 { 286 283 PRINT(0)("=== TEXT: %s (with Font:'%s') displaying %s ===\n", this->getName(), this->font->getName(), this->text.c_str()); 287 PRINT(0)("Color: %0.2f %0.2f %0.2f\n", this->color.x, this->color.y, this->color.z);288 } 289 284 PRINT(0)("Color: r=%0.2f g=%0.2f b=%0.2f a=%0.2f\n", this->color.r(), this->color.g(), this->color.b(), this->color.a()); 285 } 286 -
trunk/src/lib/graphics/text_engine/text.h
r7919 r8448 8 8 9 9 #include "element_2d.h" 10 #include "color.h" 10 11 11 12 #define TEXT_ALIGN_LEFT E2D_ALIGN_LEFT … … 13 14 #define TEXT_ALIGN_CENTER E2D_ALIGN_CENTER 14 15 #define TEXT_ALIGN_SCREEN_CENTER E2D_ALIGN_SCREEN_CENTER 15 #define TEXT_DEFAULT_COLOR Vector(1.0, 1.0, 1.0) //!< the default Color (white) 16 #define TEXT_DEFAULT_BLENDING 1.0f //!< the default blending of the text, (no blending at all) 16 #define TEXT_DEFAULT_COLOR Color(1.0, 1.0, 1.0, 1.0f) //!< the default Color (white, fully visible) 17 17 18 18 #define TEXT_DEFAULT_ALIGNMENT TEXT_ALIGN_LEFT //!< default alignment … … 44 44 void setFont(const std::string& fontFile, unsigned int renderSize); 45 45 /** @param blending the blending intensity to set (between 0.0 and 1.0) */ 46 inline void setBlending(float blending) { this-> blending= blending; };46 inline void setBlending(float blending) { this->color.a() = blending; }; 47 47 /** @param r red @param g green @param b blue @brief sets the Color of the Text to render (values in [0-1]) */ 48 void setColor(float r, float g, float b) { this->color = Vector(r, g, b); }; 48 void setColor(float r, float g, float b) { this->color = Color(r, g, b, this->color.a()); }; 49 void setColor(float r, float g, float b, float a) { this->color = Color(r, g, b, a); }; 50 void setColor(const Color& color) { this->color = color; }; 49 51 void setSize(float size); 50 52 … … 57 59 inline const Font* const getFont() const { return this->font; }; 58 60 /** @returns the Blending Value [0 invisible 1.0 full visible */ 59 inline float getBlending() const { return this-> blending; };61 inline float getBlending() const { return this->color.a(); }; 60 62 /** @returns: a Vector(r,g,b) @brief: retrieve a Vector holding the Color of the Text */ 61 inline const Vector& getColor() const { return this->color; };63 inline const Color& getColor() const { return this->color; }; 62 64 /** @returns the Size of the Text */ 63 65 inline float getSize() const { return this->size; }; … … 76 78 77 79 std::string text; //!< The text to display 78 Vector color; //!< The color of the font. 79 float blending; //!< The blending intensity. 80 Color color; //!< The color of the font. 80 81 float size; //!< The size of the Text. 81 82 };
Note: See TracChangeset
for help on using the changeset viewer.