- throw InvalidState("Textures may only be created once");
- if(w==0 || h==0 || d==0)
- throw InvalidParameterValue("Invalid texture dimensions");
+ throw invalid_operation("Texture3D::storage");
+ if(wd==0 || ht==0 || dp==0)
+ throw invalid_argument("Texture3D::storage");
+
+ width = wd;
+ height = ht;
+ depth = dp;
+ ifmt = fmt;
+}
+
+void Texture3D::allocate(unsigned level)
+{
+ if(allocated&(1<<level))
+ return;
+
+ image(level, get_base_pixelformat(ifmt), UNSIGNED_BYTE, 0);
+}
+
+void Texture3D::image(unsigned level, PixelFormat fmt, DataType type, const void *data)
+{
+ if(width==0 || height==0 || depth==0)
+ throw invalid_operation("Texture3D::image");