- BindRestore _bind(this);
- glTexSubImage1D(target, level, x, wd, fmt, type, data);
+ PixelComponents comp = get_components(storage_fmt);
+ DataType type = get_component_type(storage_fmt);
+ if(ARB_direct_state_access)
+ glTextureSubImage1D(id, level, x, wd, comp, type, data);
+ else
+ glTexSubImage1D(target, level, x, wd, comp, type, data);
+
+ if(auto_gen_mipmap && level==0)
+ generate_mipmap();
+}
+
+void Texture1D::sub_image(unsigned level, int x, unsigned wd, PixelComponents comp, DataType type, const void *data)
+{
+ if(comp!=get_components(format) || type!=get_component_type(format))
+ throw incompatible_data("Texture1D::sub_image");
+ sub_image(level, x, wd, data);