Changeset 3952 in orxonox.OLD for orxonox/branches/particleEngine/src/lib/graphics/importer
- Timestamp:
- Apr 25, 2005, 1:10:24 AM (20 years ago)
- Location:
- orxonox/branches/particleEngine/src/lib/graphics/importer
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/particleEngine/src/lib/graphics/importer/material.cc
r3946 r3952 100 100 } 101 101 102 102 103 // setting illumination Model 103 104 if (this->illumModel == 1) //! \todo make this work, if no vertex-normals are read. … … 110 111 glEnable(GL_TEXTURE_2D); 111 112 glBindTexture(GL_TEXTURE_2D, this->diffuseTexture->getTexture()); 113 114 /* This allows alpha blending of 2D textures with the scene */ 115 if (this->diffuseTexture->hasAlpha()) 116 { 117 glEnable(GL_BLEND); 118 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 119 } 112 120 } 113 121 else -
orxonox/branches/particleEngine/src/lib/graphics/importer/texture.cc
r3947 r3952 25 25 Texture::Texture(const char* imageName) 26 26 { 27 bAlpha = false; 27 28 this->texture = 0; 28 29 if (imageName) … … 112 113 if ( (saved_flags & SDL_SRCALPHA) == SDL_SRCALPHA ) { 113 114 SDL_SetAlpha(surface, saved_flags | SDL_OPENGL, saved_alpha); 115 this->bAlpha = true; 114 116 } 115 117 -
orxonox/branches/particleEngine/src/lib/graphics/importer/texture.h
r3905 r3952 23 23 char* searchTextureInPaths(const char* texName) const; 24 24 void swap(unsigned char &a, unsigned char &b); 25 26 bool bAlpha; //!< if the texture has an alpha channel. 25 27 public: 26 28 Texture(const char* imageName = NULL); … … 30 32 inline GLuint getTexture(void) {return this->texture;} 31 33 GLuint loadTexToGL (SDL_Surface* surface); 34 inline bool hasAlpha(void) {return bAlpha;} 32 35 33 36 bool loadImage(const char* imageName);
Note: See TracChangeset
for help on using the changeset viewer.