Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6295 in orxonox.OLD for trunk/src/lib/gui/gl_gui/glgui_bar.cc


Ignore:
Timestamp:
Dec 26, 2005, 3:01:14 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: new GUI-functionality

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/gui/gl_gui/glgui_bar.cc

    r6287 r6295  
    2121
    2222/**
    23  * standard constructor
     23 * @brief standard constructor
    2424*/
    2525GLGuiBar::GLGuiBar ()
     
    3131
    3232/**
    33  * standard deconstructor
    34 */
     33 * @brief standard deconstructor
     34 */
    3535GLGuiBar::~GLGuiBar()
    3636{
     
    3939
    4040/**
    41  * initializes the GUI-element
     41 * @brief initializes the GUI-element
    4242 */
    4343void GLGuiBar::init()
    4444{
    4545  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);
    4651
    4752  this->value = 0.5f;
     
    5156
    5257/**
    53  * draws the GLGuiBar
     58 * @brief draws the GLGuiBar
    5459 */
    5560void GLGuiBar::draw() const
    5661{
     62  this->startDraw();
    5763
    58   printf("TEST %f %f\n", this->getAbsCoor2D().x, this->getAbsCoor2D().y);
    5964  GLGuiWidget::draw();
    6065
     66  this->frontMat.select();
    6167  glBegin(GL_QUADS);
    6268
    63   glVertex2d(.1, .1);
    64   glVertex2d(.1, this->getSizeY2D()* .8 * (value/maximum));
    65   glVertex2d(this->getSizeX2D(), this->getSizeY2D() * .8 * (value/maximum));
    66   glVertex2d(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());
    6773
    6874  glEnd();
     75  this->endDraw();
    6976}
Note: See TracChangeset for help on using the changeset viewer.