Changeset 6129 in orxonox.OLD for branches/network/src/lib/graphics
- Timestamp:
- Dec 16, 2005, 2:01:16 PM (19 years ago)
- Location:
- branches/network/src/lib/graphics/importer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/graphics/importer/texture.cc
r5863 r6129 37 37 this->texture = 0; 38 38 this->image = NULL; 39 this->priority = 0.5; 39 40 40 41 if (imageName != NULL) … … 251 252 glGenTextures(1, &texture); 252 253 glBindTexture(GL_TEXTURE_2D, texture); 253 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); 254 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 254 255 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, /*GL_LINEAR*/ GL_LINEAR_MIPMAP_LINEAR); 256 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, /*GL_LINEAR*/ GL_LINEAR); 257 /* control the mipmap levels */ 258 glTexParameterf(GL_TEXTURE_ENV, GL_TEXTURE_MIN_LOD, -100); 259 glTexParameterf(GL_TEXTURE_ENV, GL_TEXTURE_MAX_LOD, 0); 260 glTexParameterf(GL_TEXTURE_ENV, GL_TEXTURE_PRIORITY, this->priority); 261 255 262 // build the Texture 256 263 glTexImage2D(GL_TEXTURE_2D, … … 262 269 GL_UNSIGNED_BYTE, 263 270 surface->pixels); 264 // build the MipMaps 271 272 // build the MipMaps automaticaly 265 273 gluBuild2DMipmaps(GL_TEXTURE_2D, 266 274 GL_RGBA, … … 273 281 return texture; 274 282 } 283 -
branches/network/src/lib/graphics/importer/texture.h
r5859 r6129 39 39 40 40 // Utility functionality: 41 staticSDL_Surface* prepareSurface(SDL_Surface* input, bool& hasAlpha);42 staticGLuint loadTexToGL (const SDL_Surface* surface);41 SDL_Surface* prepareSurface(SDL_Surface* input, bool& hasAlpha); 42 GLuint loadTexToGL (const SDL_Surface* surface); 43 43 44 44 protected: … … 53 53 bool bAlpha; //!< if the texture has an alpha channel. 54 54 SDL_Surface* image; //!< The SDL_Surfce that stores the Texture on it. 55 GLclampf priority; //!< the priority of the current texture (used for garphics cards with limited mem) 55 56 56 57 static bool texturesEnabled; //!< If the Textures are enabled.
Note: See TracChangeset
for help on using the changeset viewer.