Changeset 7982 in orxonox.OLD for branches/water/src/lib
- Timestamp:
- May 30, 2006, 3:30:47 PM (19 years ago)
- Location:
- branches/water/src/lib/graphics
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/water/src/lib/graphics/importer/material.cc
r7788 r7982 107 107 if (unlikely(this == Material::selectedMaterial)) 108 108 return true; 109 else if (likely(Material::selectedMaterial != NULL)) 110 { 111 Material::unselect(); 112 // for(unsigned int i = 0; i < Material::selectedMaterial->textures.size(); ++i) 113 // { 114 // glActiveTexture(Material::glTextureArbs[i]); 115 // glBindTexture(GL_TEXTURE_2D, 0); 116 // glDisable(GL_TEXTURE_2D); 117 // } 118 } 109 119 110 120 … … 137 147 else if (this->illumModel >= 2) 138 148 glShadeModel(GL_SMOOTH); 139 140 if (likely(Material::selectedMaterial != NULL))141 {142 for(unsigned int i = 0; i < Material::selectedMaterial->textures.size(); ++i)143 {144 glActiveTexture(Material::glTextureArbs[i]);145 glBindTexture(GL_TEXTURE_2D, 0);146 glDisable(GL_TEXTURE_2D);147 }148 }149 149 150 150 for(unsigned int i = 0; i < this->textures.size(); ++i) … … 172 172 } 173 173 174 void Material::unselect() 175 { 176 Material::selectedMaterial = NULL; 177 for(unsigned int i = 0; i < 8; ++i) 178 { 179 glActiveTexture(Material::glTextureArbs[i]); 180 glBindTexture(GL_TEXTURE_2D, 0); 181 glDisable(GL_TEXTURE_2D); 182 } 183 } 184 174 185 /** 175 186 * Sets the Material Illumination Model. -
branches/water/src/lib/graphics/importer/material.h
r7788 r7982 32 32 33 33 bool select () const; 34 static void unselect(); 34 35 35 36 void setIllum (int illum); -
branches/water/src/lib/graphics/shader.h
r7835 r7982 23 23 { 24 24 public: 25 Uniform(const Shader* shader, const std::string& location) { glGetUniformLocationARB(shader->getProgram(), location.c_str()) ; }26 Uniform(const Shader& shader, const std::string& location) { glGetUniformLocation(shader.getProgram(), location.c_str()) ; };27 Uniform(GLhandleARB shaderProgram, const std::string& location) { glGetUniformLocation(shaderProgram, location.c_str()) ; };25 Uniform(const Shader* shader, const std::string& location) { this->uniform = glGetUniformLocationARB(shader->getProgram(), location.c_str()) ; } 26 Uniform(const Shader& shader, const std::string& location) { this->uniform = glGetUniformLocation(shader.getProgram(), location.c_str()) ; }; 27 Uniform(GLhandleARB shaderProgram, const std::string& location) { this->uniform = glGetUniformLocation(shaderProgram, location.c_str()) ; }; 28 28 29 29 void set(float v0) const { glUniform1f(this->uniform, v0); }
Note: See TracChangeset
for help on using the changeset viewer.