]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/texture3d.cpp
Remove support for array size specialization from the engine as well
[libs/gl.git] / source / core / texture3d.cpp
index e48b7662011deb9b1c81ce5c73014c939ace2c52..c901556aa52f7aa2b84357f3ce784bf3d440279c 100644 (file)
@@ -39,11 +39,11 @@ void Texture3D::image(unsigned level, const void *data)
        return sub_image(level, 0, 0, 0, size.x, size.y, size.z, data);
 }
 
-void Texture3D::sub_image(unsigned level, int x, int y, int z, unsigned wd, unsigned ht, unsigned dp, const void *data)
+void Texture3D::sub_image(unsigned level, unsigned x, unsigned y, unsigned z, unsigned wd, unsigned ht, unsigned dp, const void *data)
 {
        if(width==0 || height==0 || depth==0)
                throw invalid_operation("Texture3D::sub_image");
-       if(level>=levels)
+       if(level>=levels || x>width || x+wd>width || y>height || y+ht>height || z>depth || z+dp>depth)
                throw out_of_range("Texture3D::sub_image");
 
        Texture3DBackend::sub_image(level, x, y, z, wd, ht, dp, data);
@@ -111,16 +111,10 @@ Texture3D::Loader::Loader(Texture3D &t, Collection &c):
 
 void Texture3D::Loader::init()
 {
-       add("raw_data", &Loader::raw_data);
        add("storage", &Loader::storage);
        add("storage", &Loader::storage_levels);
 }
 
-void Texture3D::Loader::raw_data(const string &data)
-{
-       obj.image(0, data.data());
-}
-
 void Texture3D::Loader::storage(PixelFormat fmt, unsigned w, unsigned h, unsigned d)
 {
        obj.storage(fmt, w, h, d);