- Timestamp:
- Jan 5, 2005, 11:53:36 PM (20 years ago)
- Location:
- orxonox/branches/parenting/src/importer
- Files:
-
- 2 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) -
orxonox/branches/parenting/src/importer/texture.h
r3346 r3347 61 61 GLuint height; //!< The height of the Image. 62 62 GLuint bpp; //!< BytesPerPixel 63 GLenum format; //!< The Format of the PixelData 63 64 GLuint type; //!< Type of the Image. 64 65 GLubyte *data; //!< The Image Data comes here! DANGER: uncompressed data.
Note: See TracChangeset
for help on using the changeset viewer.