- allocate(level);
-
- GLenum comp = get_gl_components(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
- {
- bind_scratch();
- glTexSubImage2D(target, level, x, y, wd, ht, comp, type, data);
- }
-}
-
-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);