X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftexture.cpp;h=004d78c2abc38d1b9bc383b361cefae647b8ac06;hb=55dbeb5e04516699b8415104e346243d5e4c48c9;hp=bda29f05cdd5a2c63f93f8cc334503c1c8e1ef97;hpb=d2efbd8a32efa2a3ee8542efc846277af19d63e0;p=libs%2Fgl.git diff --git a/source/texture.cpp b/source/texture.cpp index bda29f05..004d78c2 100644 --- a/source/texture.cpp +++ b/source/texture.cpp @@ -288,11 +288,12 @@ void Texture::Loader::init() else srgb = false; + add("external_image", &Loader::external_image); add("filter", &Loader::filter); - add("max_anisotropy", &Loader::max_anisotropy); add("generate_mipmap", &Loader::generate_mipmap); add("image_data", &Loader::image_data); add("mag_filter", &Loader::mag_filter); + add("max_anisotropy", &Loader::max_anisotropy); add("min_filter", &Loader::min_filter); add("wrap", &Loader::wrap); add("wrap_r", &Loader::wrap_r); @@ -300,6 +301,15 @@ void Texture::Loader::init() add("wrap_t", &Loader::wrap_t); } +void Texture::Loader::external_image(const string &fn) +{ + Graphics::Image img; + RefPtr io = get_collection().open_raw(fn); + img.load_io(*io); + + obj.image(img, srgb); +} + void Texture::Loader::filter(TextureFilter f) { obj.set_filter(f);