#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-void Texture::Loader::external_image(const string &fn)
+void Texture::Loader::load_external_image(Graphics::Image &img, const std::string &fn)
{
- Graphics::Image img;
RefPtr<IO::Seekable> io = get_collection().open_raw(fn);
if(!io)
throw IO::file_not_found(fn);
img.load_io(*io);
+}
+void Texture::Loader::external_image(const string &fn)
+{
+ Graphics::Image img;
+ load_external_image(img, fn);
obj.image(img, get_levels(), srgb);
}
void init();
unsigned get_levels() const;
+ protected:
+ void load_external_image(Graphics::Image &, const std::string &);
+ private:
void external_image(const std::string &);
void filter(TextureFilter);
void generate_mipmap(bool);
void Texture2DArray::Loader::external_image(unsigned z, const string &fn)
{
Graphics::Image img;
- RefPtr<IO::Seekable> io = get_collection().open_raw(fn);
- if(!io)
- throw IO::file_not_found(fn);
- img.load_io(*io);
-
+ load_external_image(img, fn);
obj.layer_image(0, z, img);
}