Ignore:
Timestamp:
07/26/14 04:25:23 (11 years ago)
Author:
epyon
Message:
  • nmd_loader now (temporarily) holds nmd dump code
  • image_data now holds pixel format information
  • minor cleanups
File:
1 edited

Legend:

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

    r245 r292  
    8181                return nullptr;
    8282        }
    83         image_data* data = new image_data( glm::ivec2( image->w, image->h ), image->format->BytesPerPixel, (nv::uint8*)image->pixels );
     83        // TODO: BGR vs RGB, single channel
     84        assert( image->format->BytesPerPixel > 2 );
     85        image_format format(image->format->BytesPerPixel == 3 ? RGB : RGBA, UBYTE );
     86        image_data* data = new image_data( format, glm::ivec2( image->w, image->h ), (nv::uint8*)image->pixels );
    8487        return data;
    8588}
    8689
    87 texture2d* gl_device::create_texture2d( ivec2 size, image_format aformat, datatype adatatype, sampler asampler, void* data /*= nullptr */ )
     90texture2d* gl_device::create_texture2d( ivec2 size, pixel_format aformat, datatype adatatype, sampler asampler, void* data /*= nullptr */ )
    8891{
    8992        return new gl_texture2d( size, aformat, adatatype, asampler, data );
Note: See TracChangeset for help on using the changeset viewer.