Changeset 7524 in orxonox.OLD for branches/bsp_model/src/lib/graphics/importer/material.cc
- Timestamp:
- May 3, 2006, 5:20:13 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/bsp_model/src/lib/graphics/importer/material.cc
r7513 r7524 167 167 glActiveTexture(Material::glTextureArbs[i]); 168 168 glEnable(GL_TEXTURE_2D); 169 if(this->textures[i]->hasAlpha()) 170 { 171 glEnable(GL_BLEND); 172 } 169 173 glBindTexture(GL_TEXTURE_2D, this->textures[i]->getTexture()); 170 174 } … … 355 359 356 360 /** 361 * Sets the Materials Diffuse Map 362 * @param surface pointer to SDL_Surface which shall be used as texture 363 */ 364 void Material::setSDLDiffuseMap(SDL_Surface *surface, GLenum target, unsigned int textureNumber) 365 { 366 assert(textureNumber < Material::getMaxTextureUnits()); 367 368 369 if (this->textures.size() > textureNumber && this->textures[textureNumber] != NULL) 370 ResourceManager::getInstance()->unload(this->textures[textureNumber]); 371 372 if (this->textures.size() <= textureNumber) 373 this->textures.resize(textureNumber+1, NULL); 374 375 if(surface != NULL) 376 { 377 this->textures[textureNumber] = &Texture(surface, GL_TEXTURE_2D); 378 } 379 else 380 { 381 this->textures[textureNumber] = NULL; 382 } 383 384 } 385 386 387 /** 357 388 * Sets the Materials Ambient Map 358 389 * @param aMap the Name of the Image to Use
Note: See TracChangeset
for help on using the changeset viewer.