+}
+
+void Texture3D::image(unsigned level, PixelComponents comp, DataType type, const void *data)
+{
+ if(comp!=get_components(format) || type!=get_component_type(format))
+ throw incompatible_data("Texture3D::image");
+ image(level, data);
+}
+
+void Texture3D::sub_image(unsigned level, int x, int y, int z, unsigned wd, unsigned ht, unsigned dp, const void *data)
+{
+ if(width==0 || height==0 || depth==0)
+ throw invalid_operation("Texture3D::image");
+
+ Conditional<BindRestore> _bind(!ARB_direct_state_access, this);
+ allocate(level);
+
+ PixelComponents comp = get_components(storage_fmt);
+ DataType type = get_component_type(storage_fmt);
+ if(ARB_direct_state_access)
+ glTextureSubImage3D(id, level, x, y, z, wd, ht, dp, comp, type, data);
+ else
+ glTexSubImage3D(target, level, x, y, z, wd, ht, dp, comp, type, data);
+
+ if(auto_gen_mipmap && level==0)
+ generate_mipmap();
+}
+
+void Texture3D::sub_image(unsigned level, int x, int y, int z, unsigned wd, unsigned ht, unsigned dp, PixelComponents comp, DataType type, const void *data)
+{
+ if(comp!=get_components(format) || type!=get_component_type(format))
+ throw incompatible_data("Texture3D::sub_image");
+ sub_image(level, x, y, z, wd, ht, dp, data);
+}
+
+void Texture3D::image(const Graphics::Image &img, unsigned lv)
+{
+ unsigned w = img.get_width();
+ unsigned h = img.get_height();
+
+ if(h%w)
+ throw incompatible_data("Texture3D::load_image");
+ unsigned d = h/w;
+ h = w;