unsigned w = get_level_size(level);
- BindRestore _bind(this);
if(ARB_texture_storage)
return sub_image(level, 0, w, fmt, type, data);
+ BindRestore _bind(this);
glTexImage1D(target, level, ifmt, w, 0, fmt, type, data);
allocated |= 1<<level;
if(width==0)
throw invalid_operation("Texture3D::image");
+ BindRestore _bind(this);
allocate(level);
- BindRestore _bind(this);
glTexSubImage1D(target, level, x, wd, fmt, type, data);
if(gen_mipmap && level==0)
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)
unsigned d = depth;
get_level_size(level, w, h, d);
- BindRestore _bind(this);
if(ARB_texture_storage)
return sub_image(level, 0, 0, 0, w, h, d, fmt, type, data);
+ BindRestore _bind(this);
glTexImage3D(target, level, ifmt, width, height, depth, 0, fmt, type, data);
allocated |= 1<<level;
if(width==0 || height==0 || depth==0)
throw invalid_operation("Texture3D::image");
+ BindRestore _bind(this);
allocate(level);
- BindRestore _bind(this);
glTexSubImage3D(target, level, x, y, z, wd, ht, dp, fmt, type, data);
if(gen_mipmap && level==0)
if(s==0)
throw out_of_range("TextureCube::image");
- BindRestore _bind(this);
if(ARB_texture_storage)
return sub_image(face, level, 0, 0, s, s, fmt, type, data);
+ BindRestore _bind(this);
glTexImage2D(face, level, ifmt, s, s, 0, fmt, type, data);
// XXX Allocation should be tracked per-face, but we'll run out of bits
if(size==0)
throw invalid_operation("TextureCube::sub_image");
+ BindRestore _bind(this);
allocate(level);
- BindRestore _bind(this);
glTexSubImage2D(face, level, x, y, wd, ht, fmt, type, data);
if(gen_mipmap && level==0)