X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fbuffer.h;h=9737a2ea9323ddd0af5c44b3d51d595eff6fc6d1;hb=160e9eea29bd10034733d59507fa1bcca36be401;hp=df570d7eb01d2b8bae9f6115adfb2345435c4c53;hpb=acaefb4c669f01855252818ef0a2958cbdababc3;p=libs%2Fgl.git diff --git a/source/core/buffer.h b/source/core/buffer.h index df570d7e..9737a2ea 100644 --- a/source/core/buffer.h +++ b/source/core/buffer.h @@ -3,6 +3,7 @@ #include #include +#include "buffer_backend.h" namespace Msp { namespace GL { @@ -21,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. */ @@ -54,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