Ignore:
Timestamp:
01/12/17 19:15:29 (8 years ago)
Author:
epyon
Message:
  • unified pixel_format instead of image_format
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gl/gl_device.cc

    r534 r535  
    3636        }
    3737        // TODO: BGR vs RGB, single channel
    38         pixel_format pformat = RGBA;
     38        pixel_format pformat = RGBA8;
    3939        switch ( image->format->BytesPerPixel )
    4040        {
    41         case 4: pformat = RGBA; break;
    42         case 3: pformat = RGB; break;
    43         case 1: pformat = RED; break;
     41        case 4: pformat = RGBA8; break;
     42        case 3: pformat = RGB8; break;
     43        case 1: pformat = R8; break;
    4444        default: NV_ASSERT( false, "BytesPerPixel != 4,3 or 1!" );
    4545        }
    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 ) );
    4847        return data;
    4948}
     
    6261        // TODO: BGR vs RGB, single channel
    6362        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 );
    6564        image_data* idata = new image_data( format, ivec2( image->w, image->h ), static_cast<nv::uint8*>( image->pixels ) );
    6665        return idata;
Note: See TracChangeset for help on using the changeset viewer.