Changeset 4850 in orxonox.OLD for orxonox/trunk/src/lib
- Timestamp:
- Jul 13, 2005, 7:23:20 PM (19 years ago)
- Location:
- orxonox/trunk/src/lib/graphics
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/graphics/graphics_engine.cc
r4849 r4850 21 21 22 22 #include "render_2d.h" 23 #include "light.h" 23 24 #include "debug.h" 24 25 #include "text_engine.h" … … 433 434 { 434 435 Render2D::getInstance()->draw(); 435 436 LightManager::getInstance()->draw(); 436 437 } 437 438 -
orxonox/trunk/src/lib/graphics/render2D/element_2d.h
r4849 r4850 45 45 class Element2D : virtual public BaseObject { 46 46 47 public:48 Element2D();49 virtual ~Element2D();47 public: 48 Element2D(); 49 virtual ~Element2D(); 50 50 51 void setPosition(int xCoord, int yCoord);52 void setLayer(E2DLayer layer);53 /** @param visible true if the Element should be visible false otherwise (will not be rendered) */54 inline void setVisibility(bool visible) { this->visible = visible; };55 /** @param bindNode the Node this 2D-element should follow. if NULL the Element will not follow anything */56 inline void setBindNode(const PNode* bindNode) { this->bindNode = bindNode; };51 void setPosition2D(int xCoord, int yCoord); 52 void setLayer(E2DLayer layer); 53 /** @param visible true if the Element should be visible false otherwise (will not be rendered) */ 54 inline void setVisibility(bool visible) { this->visible = visible; }; 55 /** @param bindNode the Node this 2D-element should follow. if NULL the Element will not follow anything */ 56 // inline void setBindNode(const PNode* bindNode) { this->bindNode = bindNode; }; 57 57 58 /** @returns the visibility state */59 inline bool isVisible() { return this->visible; };58 /** @returns the visibility state */ 59 inline bool isVisible() { return this->visible; }; 60 60 61 void positioning();62 virtual void tick(float dt);63 virtual void draw() const = NULL;61 void positioning(); 62 virtual void tick(float dt); 63 virtual void draw() const = NULL; 64 64 65 65 private: 66 66 void init(); 67 67 68 private: 69 bool visible; 70 int relPos2D[2]; //!< X-coord, Y-Coord (relative to the Coordinates of the alignment if given.) 71 Position2D absPos2D; //!< The absolute position of the 2D-Element. 72 E2DLayer layer; 68 protected: 69 const PNode* bindNode; //!< a node over which to display this 2D-element 70 private: 71 bool visible; 72 int relPos2D[2]; //!< X-coord, Y-Coord (relative to the Coordinates of the alignment if given.) 73 Position2D absPos2D; //!< The absolute position of the 2D-Element. 74 E2DLayer layer; 73 75 74 E2D_ALIGNMENT alignment; //!< How the Element is aligned around its Position 75 const PNode* bindNode; //!< a node over which to display this 2D-element 76 E2D_ALIGNMENT alignment; //!< How the Element is aligned around its Position 76 77 }; 77 78 -
orxonox/trunk/src/lib/graphics/text_engine.cc
r4836 r4850 74 74 { 75 75 TextEngine::getInstance()->deleteText(this); 76 }77 78 /**79 * tells the Text, that it should folow a PNode80 * @param bindNode: the node to bind this text to81 */82 void Text::setBindNode(PNode* bindNode)83 {84 this->bindNode = bindNode;85 76 } 86 77 … … 185 176 186 177 /** 187 * draws the Font178 * draws the Text 188 179 */ 189 180 void Text::draw() const … … 217 208 // setting the Blending effects 218 209 glColor4f(1.0f,1.0f,1.0f, this->blending); 210 glEnable(GL_BLEND); 211 glEnable(GL_TEXTURE_2D); 219 212 glBlendFunc(GL_SRC_ALPHA, GL_ONE); 220 213 -
orxonox/trunk/src/lib/graphics/text_engine.h
r4836 r4850 26 26 #endif 27 27 28 #include "base_object.h" 29 #include "element_2d.h" 30 28 31 #include "vector.h" 29 #include "base_object.h"30 32 31 33 // FORWARD DECLARATION … … 104 106 //////////// 105 107 //! Represents one textElement. 106 class Text : public BaseObject108 class Text : public Element2D 107 109 { 108 110 friend class TextEngine; 109 111 public: 110 112 ~Text(); 111 112 void setBindNode(PNode* bindNode);113 113 114 114 void setType(int type); … … 124 124 void createTexture(); 125 125 126 v oid draw() const;126 virtual void draw() const; 127 127 128 128 void debug() const; … … 147 147 TexCoord texCoord; //!< Texture-coordinates @todo fix this to have a struct 148 148 SDL_Rect posSize; //!< An SDL-Rectangle representing the position and size of the Text on the screen. 149 150 PNode* bindNode; //!< A node the Text is bind to. (if NULL thr node will not be bound to anything.)151 149 }; 152 150
Note: See TracChangeset
for help on using the changeset viewer.