Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8035 in orxonox.OLD for trunk/src/lib/gui/gl_gui/glgui_image.cc


Ignore:
Timestamp:
May 31, 2006, 4:20:51 PM (19 years ago)
Author:
bensch
Message:

gui: merged the gui back to the trunk

File:
1 edited

Legend:

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

    r7779 r8035  
    4343  void GLGuiImage::init()
    4444  {
    45     this->setClassID(CL_GLGUI_, "GLGuiImage");
     45    this->setClassID(CL_GLGUI_IMAGE, "GLGuiImage");
    4646
     47    this->frontMaterial().setDiffuseMap(this->texture);
     48    this->frontMaterial().setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
     49
     50    this->resize();
    4751  }
    4852
     53
     54  void GLGuiImage::loadImageFromTexture(const Texture& texture)
     55  {
     56    this->frontMaterial().setDiffuseMap(texture);
     57    this->frontMaterial().setDiffuse(1,1,1);
     58  }
     59
     60  void GLGuiImage::loadImageFromFile(const std::string& fileName)
     61  {
     62    this->texture.loadImage(fileName);
     63  }
     64
     65  void GLGuiImage::loadImageFromSDLSurface(SDL_Surface* surface)
     66  {
     67    //this->texture.loadSurface(surface);
     68  }
     69
     70  void GLGuiImage::loadImageFromDisplayList(GLuint texture)
     71  {
     72//    this->texture.setTexture(texture);
     73  }
     74
     75  void GLGuiImage::resize()
     76  {
     77    this->frontRect().setTopLeft(this->borderSize(), this->borderSize());
     78    this->frontRect().setSize(this->getSizeX2D() -2.0*this->borderSize(), this->getSizeY2D() - 2.0* this->borderSize() );
     79    GLGuiWidget::resize();
     80  }
     81
     82
    4983  /**
    50    * draws the GLGuiImage
     84   * @brief draws the GLGuiImage
    5185   */
    52   void GLGuiImage::draw()
     86  void GLGuiImage::draw() const
    5387  {
     88    this->beginDraw();
     89    GLGuiWidget::draw();
     90
     91    this->frontMaterial().select();
     92    this->drawRect(this->frontRect());
     93    this->endDraw();
    5494  }
    5595}
Note: See TracChangeset for help on using the changeset viewer.