return sub_image(level, 0, 0, w, h, fmt, type, data);
BindRestore _bind(this);
- glTexImage2D(target, level, ifmt, w, h, 0, fmt, type, data);
+ glTexImage2D(target, level, ifmt, w, h, 0, get_upload_format(fmt), type, data);
allocated |= 1<<level;
if(gen_mipmap && level==0)
Conditional<BindRestore> _bind(!ARB_direct_state_access, this);
allocate(level);
+ fmt = get_upload_format(fmt);
if(ARB_direct_state_access)
glTextureSubImage2D(id, level, x, y, wd, ht, fmt, type, data);
else