]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texture3d.cpp
Throw an exception if Texture*::allocate is called before storage
[libs/gl.git] / source / texture3d.cpp
index 4cba3afccbfade39750ef6ec00cd890182142b58..5e1f9866e185e6ecdb047f167a26ffa8054d03ea 100644 (file)
@@ -48,6 +48,8 @@ void Texture3D::storage(PixelFormat fmt, unsigned wd, unsigned ht, unsigned dp)
 
 void Texture3D::allocate(unsigned level)
 {
+       if(width==0 || height==0 || depth==0)
+               throw invalid_operation("Texture3D::allocate");
        if(allocated&(1<<level))
                return;