Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


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

orxonox/trunk: new GUI-functionality

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  
    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}
  • trunk/src/lib/gui/gl_gui/glgui_pushbutton.cc

    r6287 r6295  
    4646{
    4747  this->setClassID(CL_GLGUI_PUSHBUTTON, "GLGuiPushButton");
     48  this->frontMat.setDiffuse(1,0,0);
    4849//  this->label->setRelCoor2D(10, 10);
    4950}
     
    5657  this->startDraw();
    5758
    58   GLGuiButton::draw();
     59//  GLGuiButton::draw();
    5960
     61  this->frontMat.select();
    6062  glBegin(GL_QUADS);
    6163
  • trunk/src/lib/gui/gl_gui/glgui_widget.cc

    r6287 r6295  
    5454//  this->setParent2D((Element2D*)NULL);
    5555
    56   this->backMat = new Material();
    57   this->backMat->setDiffuse(0, 0, 0);
     56  this->backMat.setDiffuse(.1, .5, .5);
     57  this->backMat.setTransparency(.9);
    5858
    59   this->frontMat = NULL;
    6059  this->frontModel = 0;
    6160
     
    111110void GLGuiWidget::draw() const
    112111{
    113   this->backMat->select();
     112  this->backMat.select();
    114113
    115114  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);
    123119  glEnd();
    124120}
  • trunk/src/lib/gui/gl_gui/glgui_widget.h

    r6287 r6295  
    1010#include "event.h"
    1111
     12#include "material.h"
     13
    1214#include "glincl.h"
    1315#include "executor/executor.h"
     
    1921{
    2022  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,
    2729
    28   GLGuiSignalCount      = 7,
     30  GLGuiSignalCount,
    2931} GLGuiSignalType;
    3032
     
    6870    inline void endDraw() const { glPopMatrix(); };
    6971
    70   private:
    71     Material*             backMat;
     72  protected:
     73    Material              backMat;
    7274    GLuint                backModel;
    7375
    74     Material*             frontMat;
     76    Material              frontMat;
    7577    GLuint                frontModel;
    7678
Note: See TracChangeset for help on using the changeset viewer.