Changeset 3952 in orxonox.OLD for orxonox/branches/particleEngine/src/lib/graphics
- Timestamp:
- Apr 25, 2005, 1:10:24 AM (20 years ago)
- Location:
- orxonox/branches/particleEngine/src/lib/graphics
- Files:
-
- 4 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); -
orxonox/branches/particleEngine/src/lib/graphics/particles/particle_system.cc
r3951 r3952 230 230 // glDisable(GL_LIGHTING); 231 231 material->select(); 232 glPushAttrib(GL_ENABLE_BIT);233 glDisable(GL_DEPTH_TEST);234 glDisable(GL_CULL_FACE);235 glDisable(GL_LIGHTING); // will be set back when leaving 2D-mode236 glEnable(GL_TEXTURE_2D);237 238 /* This allows alpha blending of 2D textures with the scene */239 glEnable(GL_BLEND);240 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);241 242 232 243 233 Particle* drawPart = particles; … … 259 249 glEnd(); 260 250 } 261 glPopAttrib();262 263 251 } 264 252
Note: See TracChangeset
for help on using the changeset viewer.