]> git.tdb.fi Git - libs/gl.git/blobdiff - source/buffer.h
Move buffer resizing out of Bufferable
[libs/gl.git] / source / buffer.h
index 39e88cd1ce7647b74ea5f7f6b75cba575ea0d403..fc9ace78c0ac0f48194a20fdcb1a8e4012be01e1 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef MSP_GL_BUFFER_H_
 #define MSP_GL_BUFFER_H_
 
+#include <stdexcept>
+#include <string>
 #include <vector>
 #include "gl.h"
 #include <msp/gl/extensions/arb_pixel_buffer_object.h>
 namespace Msp {
 namespace GL {
 
+class buffer_too_small: public std::logic_error
+{
+public:
+       buffer_too_small(const std::string &w): std::logic_error(w) { }
+       virtual ~buffer_too_small() throw() { }
+};
+
 enum BufferType
 {
        ARRAY_BUFFER         = GL_ARRAY_BUFFER,
@@ -87,6 +96,8 @@ public:
 
        unsigned get_size() const { return size; }
 
+       void require_size(unsigned) const;
+
        BufferRange *create_range(unsigned, unsigned);
 
        void *map(BufferAccess);