Changeset 461 for trunk/src/gl
- Timestamp:
- 08/19/15 19:01:16 (10 years ago)
- Location:
- trunk/src/gl
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gl/gl_device.cc
r439 r461 51 51 } 52 52 // TODO: BGR vs RGB, single channel 53 assert( image->format->BytesPerPixel > 2 ); 54 image_format format(image->format->BytesPerPixel == 3 ? RGB : RGBA, UBYTE ); 53 pixel_format pformat = RGBA; 54 switch ( image->format->BytesPerPixel ) 55 { 56 case 4: pformat = RGBA; break; 57 case 3: pformat = RGB; break; 58 case 1: pformat = RED; break; 59 default: NV_ASSERT( false, "BytesPerPixel != 4,3 or 1!" ); 60 } 61 image_format format( pformat, UBYTE ); 55 62 image_data* data = new image_data( format, ivec2( image->w, image->h ), static_cast<nv::uint8*>( image->pixels ) ); 56 63 return data; -
trunk/src/gl/gl_enum.cc
r438 r461 184 184 case BGR : return GL_BGR; 185 185 case BGRA : return GL_BGRA; 186 case RED : return GL_RED; 186 187 NV_RETURN_COVERED_DEFAULT( 0 ); 187 188 } … … 200 201 case BGR : return GL_RGB8; 201 202 case BGRA : return GL_RGBA8; 203 case RED : return 0x8040; // GL_LUMINANCE8; // TODO: change to GL_R8! 204 202 205 NV_RETURN_COVERED_DEFAULT( 0 ); 203 206 }
Note: See TracChangeset
for help on using the changeset viewer.