+ if(allocated&(1<<level))
+ return;
+
+ image(level, get_base_pixelformat(ifmt), UNSIGNED_BYTE, 0);
+}
+
+void Texture2D::image(unsigned level, PixelFormat fmt, DataType type, const void *data)
+{
+ if(width==0 || height==0)
+ throw invalid_operation("Texture2D::image");
+
+ unsigned w = width;
+ unsigned h = height;
+ get_level_size(level, w, h);