Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8575 in orxonox.OLD for branches


Ignore:
Timestamp:
Jun 18, 2006, 11:01:40 PM (18 years ago)
Author:
bensch
Message:

gui: better names

Location:
branches/gui/src
Files:
5 edited

Legend:

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

    r8572 r8575  
    5959  void setSpecularMap(const std::string& sMap, GLenum target = GL_TEXTURE_2D);
    6060  void setBump(const std::string& bump);
    61   GLuint getDiffuseTexture(unsigned int i = 0) const { return (this->textures.size() > i)? this->textures[i].getTexture() : 0; };
     61
     62  GLuint diffuseTextureID(unsigned int i = 0) const { return (this->textures.size() > i)? this->textures[i].getTexture() : 0; };
     63
     64  const Texture& diffuseTexture(unsigned int i = 0) const { return this->textures[i]; };
    6265
    6366  static void addTexturePath(const std::string& pathName);
  • branches/gui/src/lib/gui/gl/glgui_style.cc

    r8559 r8575  
    282282  void GLGuiStyle::setBackgroundColor(const Color& color, OrxGui::State state)
    283283  {
    284     _style[state]._backgroundColor = color;
     284    _style[state]._background.setDiffuseColor(color);
    285285  }
    286286
     
    320320  void GLGuiStyle::setBackgroundTexture(const Texture& texture, OrxGui::State state)
    321321  {
    322     _style[state]._backgroundTexture = texture;
     322    _style[state]._background.setDiffuseMap(texture);
    323323  }
    324324
     
    355355  void GLGuiStyle::setForegroundColor(const Color& color, OrxGui::State state)
    356356  {
    357     _style[state]._foregroundColor = color;
     357    _style[state]._foreground.setDiffuseColor(color);
    358358  }
    359359
  • branches/gui/src/lib/gui/gl/glgui_style.h

    r8559 r8575  
    1111#include "glgui_defs.h"
    1212
     13#include "material.h"
    1314#include "font.h"
    1415#include "texture.h"
     
    3435    /** @returns bottom borderWidth @param state the State to retrieve from */
    3536    inline float borderBottom(OrxGui::State state = GLGUI_DEFAULT_STYLE) const { return _style[state]._borderBottom; }
     37
    3638    /** @returns textSize @param state the State to retrieve from */
    3739    inline float textSize(OrxGui::State state = GLGUI_DEFAULT_STYLE) const { return _style[state]._textSize; }
    3840    /** @returns the Background Color @param state the State to retrieve from */
    39     inline const Color& backgroundColor(OrxGui::State state= GLGUI_DEFAULT_STYLE) const { return _style[state]._backgroundColor; }
     41    inline const Color& backgroundColor(OrxGui::State state= GLGUI_DEFAULT_STYLE) const { return _style[state]._background.diffuseColor(); }
    4042    /** @returns background Texture. @param state the State to retrieve from */
    41     inline const Texture& backgrorundTexture(OrxGui::State state= GLGUI_DEFAULT_STYLE) const { return _style[state]._backgroundTexture; }
     43    inline const Texture& backgrorundTexture(OrxGui::State state= GLGUI_DEFAULT_STYLE) const { return _style[state]._background.diffuseTexture(); }
    4244    /** @returns the foreground Color @param state the State to retrieve from */
    43     inline const Color& foregroundColor(OrxGui::State state= GLGUI_DEFAULT_STYLE) const { return _style[state]._foregroundColor; }
     45    inline const Color& foregroundColor(OrxGui::State state= GLGUI_DEFAULT_STYLE) const { return _style[state]._foreground.diffuseColor(); }
    4446
    4547    /** @returns FeaturePosition */
     
    113115      float             _textSize;             //!< The TextSize of the Widget.
    114116
    115       Color             _backgroundColor;      //!< The BackgroundColor of the Widget.
    116       Texture           _backgroundTexture;    //!< The BackgroundTexture of the Widget.
     117      Material          _background;           //!< The Background Material of the Widget.
    117118
    118       Color             _foregroundColor;      //!< The foregroundColor of the Widget.
     119      Material          _foreground;           //!< The foreground Material of the Widget.
    119120    }
    120121    StatedStyle;
  • branches/gui/src/world_entities/environments/mapped_water.cc

    r8312 r8575  
    8080  memset(pTextureReflection, 0, this->textureSize * this->textureSize * channels * sizeof(unsigned int));
    8181  //mat.select();
    82   glBindTexture(GL_TEXTURE_2D, this->mat.getDiffuseTexture(0));
     82  glBindTexture(GL_TEXTURE_2D, this->mat.diffuseTextureID(0));
    8383  glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
    8484  glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
     
    9090  unsigned int* pTextureRefraction = new unsigned int [this->textureSize * this->textureSize * channels];
    9191  memset(pTextureRefraction, 0, this->textureSize * this->textureSize * channels * sizeof(unsigned int));
    92   glBindTexture(GL_TEXTURE_2D, this->mat.getDiffuseTexture(1));
     92  glBindTexture(GL_TEXTURE_2D, this->mat.diffuseTextureID(1));
    9393  glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
    9494  glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
     
    281281  ///
    282282
    283   glBindTexture(GL_TEXTURE_2D, this->mat.getDiffuseTexture(0));
     283  glBindTexture(GL_TEXTURE_2D, this->mat.diffuseTextureID(0));
    284284
    285285  // Create the texture and store it on the video card
     
    351351  if(pos.y > waterHeight)
    352352  {
    353     double plane[4] = {0.0, -1.0, 0.0, waterHeight}; 
     353    double plane[4] = {0.0, -1.0, 0.0, waterHeight};
    354354    glClipPlane(GL_CLIP_PLANE0, plane);
    355355
     
    359359  {
    360360    glCullFace(GL_FRONT);
    361     double plane[4] = {0.0, 1.0, 0.0, -waterHeight}; 
     361    double plane[4] = {0.0, 1.0, 0.0, -waterHeight};
    362362    glClipPlane(GL_CLIP_PLANE0, plane);
    363363  }
     
    370370
    371371
    372   glBindTexture(GL_TEXTURE_2D, this->mat.getDiffuseTexture(1));
     372  glBindTexture(GL_TEXTURE_2D, this->mat.diffuseTextureID(1));
    373373
    374374  // Create the texture and store it on the video card
  • branches/gui/src/world_entities/skybox.h

    r7954 r8575  
    5353                           const std::string& posY, const std::string& negZ, const std::string& posZ);
    5454
    55   GLuint getTexture(SKY_SIDE side) const { return (this->material[side]) ? this->material[side]->getDiffuseTexture(): 0; };
     55  GLuint getTexture(SKY_SIDE side) const { return (this->material[side]) ? this->material[side]->diffuseTextureID(): 0; };
    5656
    5757  static void enableCubeMap();
     
    6969  float           textureSize;     //!< this is the length of a texture (assumes a square texture)
    7070  std::string     textureName;     //!< Name of the Texture
    71  
     71
    7272  int textureName_handle;          //!< used to notify about changes of textureName
    7373  int size_handle;                 //!< used to notify about changes of size
Note: See TracChangeset for help on using the changeset viewer.