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("wrap_t", &Loader::wrap_t);
}
+void Texture::Loader::external_image(const string &fn)
+{
+ Graphics::Image img;
+ RefPtr<IO::Seekable> io = get_collection().open_raw(fn);
+ img.load_io(*io);
+
+ obj.image(img, srgb);
+}
+
void Texture::Loader::filter(TextureFilter f)
{
obj.set_filter(f);
private:
void init();
+ void external_image(const std::string &);
void filter(TextureFilter);
void generate_mipmap(bool);
void image_data(const std::string &);
+#include <msp/datafile/collection.h>
#include <msp/gl/extensions/arb_texture_cube_map.h>
#include <msp/io/memory.h>
#include <msp/strings/format.h>
void TextureCube::Loader::init()
{
+ add("external_image", &Loader::external_image);
add("image_data", &Loader::image_data);
add("raw_data", &Loader::raw_data);
add("storage", &Loader::storage);
}
+void TextureCube::Loader::external_image(TextureCubeFace face, const string &fn)
+{
+ Graphics::Image img;
+ RefPtr<IO::Seekable> io = get_collection().open_raw(fn);
+ img.load_io(*io);
+
+ obj.image(face, img, srgb);
+}
+
void TextureCube::Loader::image_data(TextureCubeFace face, const string &data)
{
Graphics::Image img;
private:
void init();
+ void external_image(TextureCubeFace, const std::string &);
void image_data(TextureCubeFace, const std::string &);
void raw_data(TextureCubeFace, const std::string &);
void storage(PixelFormat, unsigned);