]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/buffer.cpp
Allow repeated storage calls with the same parameters
[libs/gl.git] / source / core / buffer.cpp
index 98625b813bdfd9a626d8be87f52e6a2d7db228d6..17e833d71dfee347e7f3b46c885bc674aa0de864 100644 (file)
@@ -49,7 +49,11 @@ void Buffer::require_buffer_type(BufferType type)
 void Buffer::storage(unsigned sz)
 {
        if(size>0)
-               throw invalid_operation("Buffer::storage");
+       {
+               if(sz!=size)
+                       throw incompatible_data("Buffer::storage");
+               return;
+       }
        if(sz==0)
                throw invalid_argument("Buffer::storage");