]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texture1d.cpp
Throw an exception if Texture*::allocate is called before storage
[libs/gl.git] / source / texture1d.cpp
index e25a11c09ce579b0fbed76a7ec6dc5a6ed5569fd..c5e57df22843d0e0dc84675c24d08bebcaaf1c74 100644 (file)
@@ -32,6 +32,8 @@ void Texture1D::storage(PixelFormat fmt, unsigned wd)
 
 void Texture1D::allocate(unsigned level)
 {
 
 void Texture1D::allocate(unsigned level)
 {
+       if(width==0)
+               throw invalid_operation("Texture1D::allocate");
        if(allocated&(1<<level))
                return;
 
        if(allocated&(1<<level))
                return;