- Timestamp:
- Jun 18, 2006, 11:01:40 PM (18 years ago)
- Location:
- branches/gui/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/src/lib/graphics/importer/material.h
r8572 r8575 59 59 void setSpecularMap(const std::string& sMap, GLenum target = GL_TEXTURE_2D); 60 60 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]; }; 62 65 63 66 static void addTexturePath(const std::string& pathName); -
branches/gui/src/lib/gui/gl/glgui_style.cc
r8559 r8575 282 282 void GLGuiStyle::setBackgroundColor(const Color& color, OrxGui::State state) 283 283 { 284 _style[state]._background Color = color;284 _style[state]._background.setDiffuseColor(color); 285 285 } 286 286 … … 320 320 void GLGuiStyle::setBackgroundTexture(const Texture& texture, OrxGui::State state) 321 321 { 322 _style[state]._background Texture = texture;322 _style[state]._background.setDiffuseMap(texture); 323 323 } 324 324 … … 355 355 void GLGuiStyle::setForegroundColor(const Color& color, OrxGui::State state) 356 356 { 357 _style[state]._foreground Color = color;357 _style[state]._foreground.setDiffuseColor(color); 358 358 } 359 359 -
branches/gui/src/lib/gui/gl/glgui_style.h
r8559 r8575 11 11 #include "glgui_defs.h" 12 12 13 #include "material.h" 13 14 #include "font.h" 14 15 #include "texture.h" … … 34 35 /** @returns bottom borderWidth @param state the State to retrieve from */ 35 36 inline float borderBottom(OrxGui::State state = GLGUI_DEFAULT_STYLE) const { return _style[state]._borderBottom; } 37 36 38 /** @returns textSize @param state the State to retrieve from */ 37 39 inline float textSize(OrxGui::State state = GLGUI_DEFAULT_STYLE) const { return _style[state]._textSize; } 38 40 /** @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]._background Color; }41 inline const Color& backgroundColor(OrxGui::State state= GLGUI_DEFAULT_STYLE) const { return _style[state]._background.diffuseColor(); } 40 42 /** @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]._background Texture; }43 inline const Texture& backgrorundTexture(OrxGui::State state= GLGUI_DEFAULT_STYLE) const { return _style[state]._background.diffuseTexture(); } 42 44 /** @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]._foreground Color; }45 inline const Color& foregroundColor(OrxGui::State state= GLGUI_DEFAULT_STYLE) const { return _style[state]._foreground.diffuseColor(); } 44 46 45 47 /** @returns FeaturePosition */ … … 113 115 float _textSize; //!< The TextSize of the Widget. 114 116 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. 117 118 118 Color _foregroundColor; //!< The foregroundColorof the Widget.119 Material _foreground; //!< The foreground Material of the Widget. 119 120 } 120 121 StatedStyle; -
branches/gui/src/world_entities/environments/mapped_water.cc
r8312 r8575 80 80 memset(pTextureReflection, 0, this->textureSize * this->textureSize * channels * sizeof(unsigned int)); 81 81 //mat.select(); 82 glBindTexture(GL_TEXTURE_2D, this->mat. getDiffuseTexture(0));82 glBindTexture(GL_TEXTURE_2D, this->mat.diffuseTextureID(0)); 83 83 glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); 84 84 glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); … … 90 90 unsigned int* pTextureRefraction = new unsigned int [this->textureSize * this->textureSize * channels]; 91 91 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)); 93 93 glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); 94 94 glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); … … 281 281 /// 282 282 283 glBindTexture(GL_TEXTURE_2D, this->mat. getDiffuseTexture(0));283 glBindTexture(GL_TEXTURE_2D, this->mat.diffuseTextureID(0)); 284 284 285 285 // Create the texture and store it on the video card … … 351 351 if(pos.y > waterHeight) 352 352 { 353 double plane[4] = {0.0, -1.0, 0.0, waterHeight}; 353 double plane[4] = {0.0, -1.0, 0.0, waterHeight}; 354 354 glClipPlane(GL_CLIP_PLANE0, plane); 355 355 … … 359 359 { 360 360 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}; 362 362 glClipPlane(GL_CLIP_PLANE0, plane); 363 363 } … … 370 370 371 371 372 glBindTexture(GL_TEXTURE_2D, this->mat. getDiffuseTexture(1));372 glBindTexture(GL_TEXTURE_2D, this->mat.diffuseTextureID(1)); 373 373 374 374 // Create the texture and store it on the video card -
branches/gui/src/world_entities/skybox.h
r7954 r8575 53 53 const std::string& posY, const std::string& negZ, const std::string& posZ); 54 54 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; }; 56 56 57 57 static void enableCubeMap(); … … 69 69 float textureSize; //!< this is the length of a texture (assumes a square texture) 70 70 std::string textureName; //!< Name of the Texture 71 71 72 72 int textureName_handle; //!< used to notify about changes of textureName 73 73 int size_handle; //!< used to notify about changes of size
Note: See TracChangeset
for help on using the changeset viewer.