Changeset 535 for trunk/src/gl/gl_device.cc
- Timestamp:
- 01/12/17 19:15:29 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gl/gl_device.cc
r534 r535 36 36 } 37 37 // TODO: BGR vs RGB, single channel 38 pixel_format pformat = RGBA ;38 pixel_format pformat = RGBA8; 39 39 switch ( image->format->BytesPerPixel ) 40 40 { 41 case 4: pformat = RGBA ; break;42 case 3: pformat = RGB ; break;43 case 1: pformat = R ED; break;41 case 4: pformat = RGBA8; break; 42 case 3: pformat = RGB8; break; 43 case 1: pformat = R8; break; 44 44 default: NV_ASSERT( false, "BytesPerPixel != 4,3 or 1!" ); 45 45 } 46 image_format format( pformat, UBYTE ); 47 image_data* data = new image_data( format, ivec2( image->w, image->h ), static_cast<nv::uint8*>( image->pixels ) ); 46 image_data* data = new image_data( pformat, ivec2( image->w, image->h ), static_cast<nv::uint8*>( image->pixels ) ); 48 47 return data; 49 48 } … … 62 61 // TODO: BGR vs RGB, single channel 63 62 NV_ASSERT( image->format->BytesPerPixel > 2, "bytes per pixel > 2!" ); 64 image_format format( image->format->BytesPerPixel == 3 ? RGB : RGBA, UBYTE);63 pixel_format format( image->format->BytesPerPixel == 3 ? RGB8 : RGBA8 ); 65 64 image_data* idata = new image_data( format, ivec2( image->w, image->h ), static_cast<nv::uint8*>( image->pixels ) ); 66 65 return idata;
Note: See TracChangeset
for help on using the changeset viewer.