Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8422 in orxonox.OLD


Ignore:
Timestamp:
Jun 14, 2006, 11:45:02 PM (18 years ago)
Author:
bensch
Message:

orxonox/gui: Coloring sceme adapted to image

Location:
branches/gui/src/lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/gui/src/lib/graphics/importer/material.h

    r8376 r8422  
    3838
    3939    void setDiffuse (float r, float g, float b);
     40    void setDiffuseColor(const Color& diffuseColor) { this->diffuse = diffuseColor; };
    4041    void setAmbient (float r, float g, float b);
    4142    void setSpecular (float r, float g, float b);
  • branches/gui/src/lib/gui/gl/glgui_image.cc

    r8378 r8422  
    1717
    1818#include "glgui_image.h"
     19
     20#include "debug.h"
    1921
    2022namespace OrxGui
     
    4547    this->setClassID(CL_GLGUI_IMAGE, "GLGuiImage");
    4648
    47 //     this->frontMaterial().setDiffuseMap(this->texture);
    48 //     this->frontMaterial().setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
     49    this->_imageMaterial.setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    4950
    5051    this->resize();
     
    5455  void GLGuiImage::loadImageFromTexture(const Texture& texture)
    5556  {
    56 /*    this->frontMaterial().setDiffuseMap(texture);
    57     this->frontMaterial().setDiffuse(1,1,1);*/
     57    this->_imageMaterial.setDiffuseMap(texture);
    5858  }
    5959
    6060  void GLGuiImage::loadImageFromFile(const std::string& fileName)
    6161  {
    62     this->texture.loadImage(fileName);
     62    this->_imageMaterial.setDiffuseMap(fileName);
    6363  }
    6464
    6565  void GLGuiImage::loadImageFromSDLSurface(SDL_Surface* surface)
    6666  {
    67     //this->texture.loadSurface(surface);
     67    this->_imageMaterial.setDiffuseMap(Texture(surface));
    6868  }
    6969
    7070  void GLGuiImage::loadImageFromDisplayList(GLuint texture)
    7171  {
    72 //    this->texture.setTexture(texture);
     72    PRINTF(2)("SORRY NOT IMPLEMENTED\n");
     73//    this->_imageMaterial.setTexture(texture);
     74  }
     75
     76  void GLGuiImage::updateFrontColor()
     77  {
     78    this->_imageMaterial.setDiffuseColor(this->frontColor());
    7379  }
    7480
    7581  void GLGuiImage::resize()
    7682  {
    77 /*    this->frontRect().setTopLeft(this->borderLeft(), this->borderTop());
    78     this->frontRect().setSize(this->getSizeX2D() - (borderLeft() + borderRight()), this->getSizeY2D() - (borderTop() + borderBottom()) );*/
     83    this->_imagePlane.setTopLeft(this->borderLeft(), this->borderTop());
     84    this->_imagePlane.setSize(this->getSizeX2D() - (borderLeft() + borderRight()), this->getSizeY2D() - (borderTop() + borderBottom()) );
    7985    GLGuiWidget::resize();
    8086  }
     
    8995    GLGuiWidget::draw();
    9096
    91 /*    this->frontMaterial().select();*/
    92 /*    this->drawRect(this->frontRect());*/
     97    this->_imageMaterial.select();
     98    this->drawRect(this->_imagePlane);
    9399    this->endDraw();
    94100  }
  • branches/gui/src/lib/gui/gl/glgui_image.h

    r8145 r8422  
    3636    DeclareSignal0(imageChanged);
    3737
     38  protected:
     39    virtual void updateFrontColor();
     40    virtual void resize();
     41
     42
    3843  private:
    3944    void init();
    40     virtual void resize();
    4145
    4246  private:
    43     Texture       texture;
     47    Rect2D        _imagePlane;
     48    Material      _imageMaterial;
    4449  };
    4550}
Note: See TracChangeset for help on using the changeset viewer.