Ignore:
Timestamp:
06/02/13 22:33:59 (12 years ago)
Author:
epyon
Message:
  • common - windows SCL warnings proper suppression
  • common - NV_DEPRECATED added
  • interface/image_data added
  • image constructible from image_data by ownership transfer
  • device - create_image_data added (temporary)
  • gl_device - create_image_data implementation (temporary)
File:
1 edited

Legend:

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

    r70 r90  
    1111#include "nv/logging.hh"
    1212#include "nv/lib/sdl12.hh"
     13#include "nv/lib/sdl_image.hh"
    1314
    1415using namespace nv;
     
    6768}
    6869
     70// this is a temporary function that will be removed once we find a way to
     71// pass binary file data around
     72image_data* nv::gl_device::create_image_data( const std::string& filename )
     73{
     74        load_sdl_image_library();
     75        SDL_Surface* image = IMG_Load( filename.c_str() );
     76        image_data* data = new image_data( glm::ivec2( image->w, image->h ), image->format->BytesPerPixel, (nv::uint8*)image->pixels );
     77        return data;
     78}
     79
    6980texture2d* gl_device::create_texture2d( ivec2 size, image_format aformat, datatype adatatype, sampler asampler, void* data /*= nullptr */ )
    7081{
Note: See TracChangeset for help on using the changeset viewer.