if(s==0)
throw out_of_range("TextureCube::image");
- BindRestore _bind(this);
if(ARB_texture_storage)
- sub_image(face, level, 0, 0, s, s, fmt, type, data);
- else
- glTexImage2D(face, level, ifmt, s, s, 0, fmt, type, data);
+ 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
allocated |= 1<<level;
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)
+ auto_generate_mipmap();
}
void TextureCube::image(TextureCubeFace face, const Graphics::Image &img, bool srgb)