]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/buffer.h
Move all OpenGL-specific code to a separate directory
[libs/gl.git] / source / core / buffer.h
index df570d7eb01d2b8bae9f6115adfb2345435c4c53..9737a2ea9323ddd0af5c44b3d51d595eff6fc6d1 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <stdexcept>
 #include <string>
+#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