- Conditional<BindRestore> _bind(!ARB_direct_state_access, this);
- allocate(level);
-
- PixelComponents comp = get_components(storage_fmt);
- GLenum type = get_gl_type(get_component_type(storage_fmt));
- if(ARB_direct_state_access)
- glTextureSubImage2D(id, level, x, y, wd, ht, comp, type, data);
- else
- glTexSubImage2D(target, level, x, y, wd, ht, comp, type, data);
-
- if(auto_gen_mipmap && level==0)
- generate_mipmap();
-}
-
-void Texture2D::sub_image(unsigned level, int x, int y, unsigned wd, unsigned ht, PixelComponents comp, DataType type, const void *data)
-{
- if(comp!=get_components(format) || type!=get_component_type(format))
- throw incompatible_data("Texture2D::sub_image");
- sub_image(level, x, y, wd, ht, data);
+ Texture2DBackend::sub_image(level, x, y, wd, ht, data);