+ allocated |= 1<<level;
+ if(gen_mipmap && level==0)
+ {
+ for(; (w || h); w>>=1, h>>=1, ++level) ;
+ allocated |= (1<<level)-1;
+ }
+}
+
+void Texture2D::sub_image(unsigned level, int x, int y, unsigned wd, unsigned ht, PixelFormat fmt, DataType type, const void *data)
+{
+ require_storage();
+ allocate(level);