- Timestamp:
- Dec 26, 2005, 3:01:14 AM (19 years ago)
- Location:
- trunk/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/importer/material.cc
r5437 r6295 75 75 { 76 76 // setting diffuse color 77 //glColor3f (diffuse[0], diffuse[1], diffuse[2]);77 glColor3f (diffuse[0], diffuse[1], diffuse[2]); 78 78 glMaterialfv(GL_FRONT, GL_DIFFUSE, this->diffuse); 79 79 -
trunk/src/lib/graphics/render2D/element_2d.cc
r6142 r6295 25 25 #include "graphics_engine.h" 26 26 #include "load_param.h" 27 #include "parser/tinyxml/tinyxml.h"28 27 #include "class_list.h" 29 28 … … 42 41 43 42 /** 44 * standard constructor43 * @brief standard constructor 45 44 * @param parent the parent to set for this Element2D 46 45 * … … 60 59 61 60 /** 62 * standard deconstructor61 * @brief standard deconstructor 63 62 * 64 63 * There are two general ways to delete an Element2D … … 97 96 98 97 /** 99 * initializes a Element2D98 * @brief initializes a Element2D 100 99 */ 101 100 void Element2D::init() … … 121 120 122 121 /** 123 * Loads the Parameters of an Element2D from...122 * @brief Loads the Parameters of an Element2D from... 124 123 * @param root The XML-element to load from 125 124 */ … … 160 159 161 160 // cycling properties 162 if (root != NULL) 163 { 164 LOAD_PARAM_START_CYCLE(root, element); 165 { 166 LoadParam_CYCLE(element, "parent", this, Element2D, addChild2D) 167 .describe("adds a new Child to the current Node."); 168 } 169 LOAD_PARAM_END_CYCLE(element); 170 } 161 LOAD_PARAM_START_CYCLE(root, element); 162 { 163 LoadParam_CYCLE(element, "parent", this, Element2D, addChild2D) 164 .describe("adds a new Child to the current Node."); 165 } 166 LOAD_PARAM_END_CYCLE(element); 171 167 } 172 168 … … 511 507 void Element2D::addChild2D (Element2D* child) 512 508 { 509 assert(child != NULL); 513 510 if( likely(child->parent != NULL)) 514 511 { … … 662 659 void Element2D::eraseChild(Element2D* child) 663 660 { 661 assert (this != NULL && child != NULL); 664 662 std::list<Element2D*>::iterator childIT = std::find(this->children.begin(), this->children.end(), child); 665 663 this->children.erase(childIT); … … 667 665 668 666 /** 669 * sets the mode of this parent manually667 * @brief sets the mode of this parent manually 670 668 * @param parentMode a String representing this parentingMode 671 669 */ … … 1051 1049 1052 1050 /** 1053 * creates the one and only NullElement2D 1054 * @param absCoordinate the cordinate of the Parent (normally Vector(0,0,0)) 1051 * @brief creates the one and only NullElement2D 1055 1052 */ 1056 1053 NullElement2D::NullElement2D () : Element2D(NULL, E2D_LAYER_BELOW_ALL) -
trunk/src/lib/gui/gl_gui/glgui_bar.cc
r6287 r6295 21 21 22 22 /** 23 * standard constructor23 * @brief standard constructor 24 24 */ 25 25 GLGuiBar::GLGuiBar () … … 31 31 32 32 /** 33 * standard deconstructor34 */33 * @brief standard deconstructor 34 */ 35 35 GLGuiBar::~GLGuiBar() 36 36 { … … 39 39 40 40 /** 41 * initializes the GUI-element41 * @brief initializes the GUI-element 42 42 */ 43 43 void GLGuiBar::init() 44 44 { 45 45 this->setClassID(CL_GLGUI_BAR, "GLGuiBar"); 46 47 this->frontMat.setDiffuse(1,0,0); 48 this->frontMat.setTransparency(.99); 49 50 this->setSize2D(50, 10); 46 51 47 52 this->value = 0.5f; … … 51 56 52 57 /** 53 * draws the GLGuiBar58 * @brief draws the GLGuiBar 54 59 */ 55 60 void GLGuiBar::draw() const 56 61 { 62 this->startDraw(); 57 63 58 printf("TEST %f %f\n", this->getAbsCoor2D().x, this->getAbsCoor2D().y);59 64 GLGuiWidget::draw(); 60 65 66 this->frontMat.select(); 61 67 glBegin(GL_QUADS); 62 68 63 glVertex2 d(.1, .1);64 glVertex2 d(.1, this->getSizeY2D()* .8* (value/maximum));65 glVertex2 d(this->getSizeX2D(), this->getSizeY2D() * .8* (value/maximum));66 glVertex2 d(this->getSizeX2D(), .1);69 glVertex2f(.1 * this->getSizeX2D(), .1 * this->getSizeY2D()); 70 glVertex2f(.1 * this->getSizeX2D(), this->getSizeY2D()* .9 * (value/maximum)); 71 glVertex2f(this->getSizeX2D() * .9, this->getSizeY2D() * .9 * (value/maximum)); 72 glVertex2f(this->getSizeX2D() * .9, .1 * this->getSizeY2D()); 67 73 68 74 glEnd(); 75 this->endDraw(); 69 76 } -
trunk/src/lib/gui/gl_gui/glgui_pushbutton.cc
r6287 r6295 46 46 { 47 47 this->setClassID(CL_GLGUI_PUSHBUTTON, "GLGuiPushButton"); 48 this->frontMat.setDiffuse(1,0,0); 48 49 // this->label->setRelCoor2D(10, 10); 49 50 } … … 56 57 this->startDraw(); 57 58 58 GLGuiButton::draw();59 // GLGuiButton::draw(); 59 60 61 this->frontMat.select(); 60 62 glBegin(GL_QUADS); 61 63 -
trunk/src/lib/gui/gl_gui/glgui_widget.cc
r6287 r6295 54 54 // this->setParent2D((Element2D*)NULL); 55 55 56 this->backMat = new Material();57 this->backMat ->setDiffuse(0, 0, 0);56 this->backMat.setDiffuse(.1, .5, .5); 57 this->backMat.setTransparency(.9); 58 58 59 this->frontMat = NULL;60 59 this->frontModel = 0; 61 60 … … 111 110 void GLGuiWidget::draw() const 112 111 { 113 this->backMat ->select();112 this->backMat.select(); 114 113 115 114 glBegin(GL_QUADS); 116 117 118 glVertex2d(0,0); 119 glVertex2d(0, this->getSizeY2D()); 120 glVertex2d(this->getSizeX2D(), this->getSizeY2D()); 121 glVertex2d(this->getSizeX2D(),0); 122 115 glVertex2d(0, 0); 116 glVertex2d(0, this->getSizeY2D()); 117 glVertex2d(this->getSizeX2D(), this->getSizeY2D()); 118 glVertex2d(this->getSizeX2D(), 0); 123 119 glEnd(); 124 120 } -
trunk/src/lib/gui/gl_gui/glgui_widget.h
r6287 r6295 10 10 #include "event.h" 11 11 12 #include "material.h" 13 12 14 #include "glincl.h" 13 15 #include "executor/executor.h" … … 19 21 { 20 22 GLGuiSignal_click = 0, 21 GLGuiSignal_release = 1,22 GLGuiSignal_rollOn = 2,23 GLGuiSignal_rollOff = 3,24 GLGuiSignal_open = 4,25 GLGuiSignal_close = 5,26 GLGuiSignal_destroy = 6,23 GLGuiSignal_release, 24 GLGuiSignal_rollOn, 25 GLGuiSignal_rollOff, 26 GLGuiSignal_open, 27 GLGuiSignal_close, 28 GLGuiSignal_destroy, 27 29 28 GLGuiSignalCount = 7,30 GLGuiSignalCount, 29 31 } GLGuiSignalType; 30 32 … … 68 70 inline void endDraw() const { glPopMatrix(); }; 69 71 70 pr ivate:71 Material *backMat;72 protected: 73 Material backMat; 72 74 GLuint backModel; 73 75 74 Material *frontMat;76 Material frontMat; 75 77 GLuint frontModel; 76 78 -
trunk/src/world_entities/space_ships/space_ship.cc
r6288 r6295 135 135 this->mouseDir = this->getAbsDir(); 136 136 137 // GLGuiButton* button = new GLGuiPushButton(); 138 // button->show(); 139 // button->setLabel("orxonox"); 140 // button->setBindNode(this); 141 137 /* GLGuiButton* button = new GLGuiPushButton(); 138 button->show(); 139 button->setLabel("orxonox"); 140 button->setBindNode(this);*/ 141 // GLGuiBar* bar = new GLGuiBar(); 142 // bar->show(); 143 // bar->setValue(7.0); 144 // bar->setMaximum(10); 145 // bar->setSize2D( 20, 100); 146 // bar->setAbsCoor2D( 10, 200); 147 // 142 148 //add events to the eventlist 143 149 registerEvent(SDLK_w);
Note: See TracChangeset
for help on using the changeset viewer.