X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fbuffer.h;h=9737a2ea9323ddd0af5c44b3d51d595eff6fc6d1;hb=641e5ebbda682a6df6f84a4627e3728dbcef3683;hp=0e1836888dfbdd083ce47fe4c9af5dbfe6bfa3a5;hpb=24b24e2203c776aacd9744bb947f5cf47b03d328;p=libs%2Fgl.git diff --git a/source/core/buffer.h b/source/core/buffer.h index 0e183688..9737a2ea 100644 --- a/source/core/buffer.h +++ b/source/core/buffer.h @@ -3,7 +3,7 @@ #include #include -#include +#include "buffer_backend.h" namespace Msp { namespace GL { @@ -22,21 +22,15 @@ A buffer for storing data in GL memory. Putting vertex and index data in buffers can improve rendering performance. The VertexArray, Mesh and UniformBlock classes contain built-in support for buffers. */ -class Buffer +class Buffer: public BufferBackend { - friend class PipelineState; - friend class Texture2D; - friend class VertexSetup; + friend BufferBackend; private: - unsigned id; unsigned size; - static Buffer *scratch_binding; - public: Buffer(); - ~Buffer(); /** Defines the storage size of the buffer. Must be called before data can be uploaded. Storage cannot be changed once set. */ @@ -55,15 +49,10 @@ public: void require_size(unsigned) const; - void *map(); - bool unmap(); - - void set_debug_name(const std::string &); + using BufferBackend::map; + using BufferBackend::unmap; -private: - void bind_scratch(); -public: - static void unbind_scratch(); + using BufferBackend::set_debug_name; }; } // namespace GL