X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fbuffer.h;h=fc9ace78c0ac0f48194a20fdcb1a8e4012be01e1;hp=39e88cd1ce7647b74ea5f7f6b75cba575ea0d403;hb=5f78db03b3285c977760a41da1e3927720e50352;hpb=76ca3c65dbb96461e42300016a85a4e158f5596b diff --git a/source/buffer.h b/source/buffer.h index 39e88cd1..fc9ace78 100644 --- a/source/buffer.h +++ b/source/buffer.h @@ -1,6 +1,8 @@ #ifndef MSP_GL_BUFFER_H_ #define MSP_GL_BUFFER_H_ +#include +#include #include #include "gl.h" #include @@ -11,6 +13,13 @@ 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);