+void TextureCube::sub_image(TextureCubeFace face, unsigned level, int x, int y, unsigned wd, unsigned ht, PixelFormat fmt, DataType type, const void *data)
+{
+ if(size==0)
+ throw invalid_operation("TextureCube::sub_image");
+
+ BindRestore _bind(this);
+ allocate(level);
+
+ glTexSubImage2D(face, level, x, y, wd, ht, get_upload_format(fmt), type, data);
+
+ if(auto_gen_mipmap && level==0)
+ generate_mipmap();
+}
+