unsigned h = img.get_height();
PixelFormat fmt = pixelformat_from_graphics(img.get_format());
if(width==0)
- {
- unsigned l = (is_mipmapped(min_filter) ? lv : 1);
- storage(storage_pixelformat_from_graphics(img.get_format(), srgb), w, h, l);
- }
+ storage(storage_pixelformat_from_graphics(img.get_format(), srgb), w, h, lv);
else if(w!=width || h!=height || (lv && lv!=levels))
throw incompatible_data("Texture2D::image");
allocated = 0;
// TODO check which params actually need refreshing
dirty_params = -1;
+ default_sampler.unload();
}
{
add("raw_data", &Loader::raw_data);
add("storage", &Loader::storage);
+ add("storage", &Loader::storage_levels);
}
void Texture2D::Loader::raw_data(const string &data)
obj.storage(fmt, w, h);
}
+void Texture2D::Loader::storage_levels(PixelFormat fmt, unsigned w, unsigned h, unsigned l)
+{
+ obj.storage(fmt, w, h, l);
+}
+
Texture2D::AsyncLoader::AsyncLoader(Texture2D &t, IO::Seekable &i):
texture(t),