Changeset 7513 in orxonox.OLD for branches/bsp_model/src
- Timestamp:
- May 3, 2006, 3:02:32 PM (19 years ago)
- Location:
- branches/bsp_model/src/lib/graphics/importer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/bsp_model/src/lib/graphics/importer/material.cc
r7510 r7513 71 71 if (this->specularTexture != NULL) 72 72 ResourceManager::getInstance()->unload(this->specularTexture); 73 } 73 74 if (this == Material::selectedMaterial) 75 Material::selectedMaterial = NULL; 76 } 77 78 79 Material* Material::selectedMaterial = NULL; 80 81 const GLenum Material::glTextureArbs[] = 82 { 83 GL_TEXTURE0_ARB, 84 GL_TEXTURE1_ARB, 85 GL_TEXTURE2_ARB, 86 GL_TEXTURE3_ARB, 87 GL_TEXTURE4_ARB, 88 GL_TEXTURE5_ARB, 89 GL_TEXTURE6_ARB, 90 GL_TEXTURE7_ARB 91 }; 74 92 75 93 … … 94 112 // } 95 113 96 const GLenum Material::glTextureArbs[] =97 {98 GL_TEXTURE0_ARB,99 GL_TEXTURE1_ARB,100 GL_TEXTURE2_ARB,101 GL_TEXTURE3_ARB,102 GL_TEXTURE4_ARB,103 GL_TEXTURE5_ARB,104 GL_TEXTURE6_ARB,105 GL_TEXTURE7_ARB106 };107 114 108 115 … … 112 119 bool Material::select() const 113 120 { 121 if (unlikely(this == Material::selectedMaterial)) 122 return true; 123 124 114 125 // setting diffuse color 115 126 glColor4f (diffuse[0], diffuse[1], diffuse[2], this->transparency); … … 141 152 glShadeModel(GL_SMOOTH); 142 153 154 if (likely(Material::selectedMaterial != NULL)) 155 { 156 for(unsigned int i = 0; i < Material::selectedMaterial->textures.size(); ++i) 157 { 158 glActiveTexture(Material::glTextureArbs[i]); 159 glBindTexture(GL_TEXTURE_2D, 0); 160 } 161 } 143 162 144 163 for(unsigned int i = 0; i < this->textures.size(); ++i) -
branches/bsp_model/src/lib/graphics/importer/material.h
r7510 r7513 67 67 68 68 private: 69 int illumModel; //!< The IlluminationModel is either flat or smooth. 70 float diffuse [4]; //!< The diffuse color of the Material. 71 float ambient [4]; //!< The ambient color of the Material. 72 float specular [4]; //!< The specular color of the Material. 73 float shininess; //!< The shininess of the Material. 74 float transparency; //!< The transperency of the Material. 75 GLenum sFactor; 76 GLenum tFactor; 69 static Material* selectedMaterial; //!< The currently selected material. 77 70 78 std::vector<Texture*> textures; //!< An Array of Textures. 71 int illumModel; //!< The IlluminationModel is either flat or smooth. 72 float diffuse [4]; //!< The diffuse color of the Material. 73 float ambient [4]; //!< The ambient color of the Material. 74 float specular [4]; //!< The specular color of the Material. 75 float shininess; //!< The shininess of the Material. 76 float transparency; //!< The transperency of the Material. 77 GLenum sFactor; 78 GLenum tFactor; 79 79 80 Texture* ambientTexture; //!< The ambient texture of the Material. 81 Texture* specularTexture; //!< The specular texture of the Material. 80 std::vector<Texture*> textures; //!< An Array of Textures. 81 82 Texture* ambientTexture; //!< The ambient texture of the Material. 83 Texture* specularTexture; //!< The specular texture of the Material. 82 84 83 85
Note: See TracChangeset
for help on using the changeset viewer.