unsigned h = height;
get_level_size(level, w, h);
- BindRestore _bind(this);
if(ARB_texture_storage)
return sub_image(level, 0, 0, w, h, fmt, type, data);
+ BindRestore _bind(this);
glTexImage2D(target, level, ifmt, w, h, 0, fmt, type, data);
allocated |= 1<<level;
if(width==0 || height==0)
throw invalid_operation("Texture2D::sub_image");
+ BindRestore _bind(this);
allocate(level);
- BindRestore _bind(this);
glTexSubImage2D(target, level, x, y, wd, ht, fmt, type, data);
if(gen_mipmap && level==0)