]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texturecube.cpp
Throw an exception if Texture*::allocate is called before storage
[libs/gl.git] / source / texturecube.cpp
index db679cf9e1259cb4feb0e087c0f3e066c40921c3..b9a8f5dd02b8cacb73f63df7bce028a5920035cd 100644 (file)
@@ -64,6 +64,8 @@ void TextureCube::storage(PixelFormat fmt, unsigned sz)
 
 void TextureCube::allocate(unsigned level)
 {
+       if(size==0)
+               throw invalid_operation("TextureCube::allocate");
        if(allocated&(1<<level))
                return;