Changeset 6295 in orxonox.OLD for trunk/src/lib/gui
- Timestamp:
- Dec 26, 2005, 3:01:14 AM (19 years ago)
- Location:
- trunk/src/lib/gui/gl_gui
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.