Changeset 3347 in orxonox.OLD for orxonox/branches/parenting/src/importer/texture.cc
- Timestamp:
- Jan 5, 2005, 11:53:36 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/parenting/src/importer/texture.cc
r3346 r3347 202 202 GL_UNSIGNED_BYTE, map->pixels ); 203 203 */ 204 gluBuild2DMipmaps(GL_TEXTURE_2D, 3, pImage->width, pImage->height, GL_RGB, GL_UNSIGNED_BYTE, pImage->data);204 gluBuild2DMipmaps(GL_TEXTURE_2D, 3, pImage->width, pImage->height, pImage->format, GL_UNSIGNED_BYTE, pImage->data); 205 205 206 206 glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST); … … 224 224 pImage->width = map->w; 225 225 pImage->data = (GLubyte*)map->pixels; 226 pImage->bpp = 3;//map->BytesPerPixel; 226 pImage->bpp = map->format->BytesPerPixel; 227 if (pImage->bpp == 3) 228 pImage->format = GL_RGB; 229 else if (pImage->bpp == 4) 230 pImage->format = GL_RGBA; 231 232 PRINTF(0)("Bits Per Pixel: %d\n", pImage->bpp); 227 233 if( !IMG_isPNG(SDL_RWFromFile(imgNameWithPath, "rb")) && !IMG_isJPG(SDL_RWFromFile(imgNameWithPath, "rb"))) 228 234 for (int i=0;i<map->h * map->w *3;i+=3)
Note: See TracChangeset
for help on using the changeset viewer.