- if(width==0)
- storage(make_pixelformat(get_components(fmt), get_component_type(fmt), use_srgb_format), w, h, lv);
- else if(w!=width || h!=height || (lv && lv!=levels))
- throw incompatible_data("Texture2D::image");
-
- PixelStore pstore = PixelStore::from_image(img);
- BindRestore _bind_ps(pstore);
+ storage(make_pixelformat(get_components(fmt), get_component_type(fmt), use_srgb_format), w, h, lv);