- image(level, get_base_pixelformat(ifmt), UNSIGNED_BYTE, 0);
+ if(ARB_texture_storage)
+ {
+ Conditional<BindRestore> _bind(!ARB_direct_state_access, this);
+ if(ARB_direct_state_access)
+ glTextureStorage2D(id, levels, ifmt, width, height);
+ else
+ glTexStorage2D(target, levels, ifmt, width, height);
+ apply_swizzle();
+ allocated |= (1<<levels)-1;
+ }
+ else
+ image(level, get_components(ifmt), get_component_type(ifmt), 0);