]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/buffer.h
Remove some unused and unnecessary things
[libs/gl.git] / source / core / buffer.h
index 0e1836888dfbdd083ce47fe4c9af5dbfe6bfa3a5..2366ec5ce0dd3269ee13db7d80bd53eade0fd565 100644 (file)
@@ -3,7 +3,7 @@
 
 #include <stdexcept>
 #include <string>
-#include <vector>
+#include "buffer_backend.h"
 
 namespace Msp {
 namespace GL {
@@ -15,29 +15,19 @@ public:
        virtual ~buffer_too_small() throw() { }
 };
 
-class BufferRange;
-
 /**
 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;
+       unsigned size = 0;
 
 public:
-       Buffer();
-       ~Buffer();
-
        /** Defines the storage size of the buffer.  Must be called before data can
        be uploaded.  Storage cannot be changed once set. */
        void storage(unsigned);
@@ -55,15 +45,10 @@ public:
 
        void require_size(unsigned) const;
 
-       void *map();
-       bool unmap();
+       using BufferBackend::map;
+       using BufferBackend::unmap;
 
-       void set_debug_name(const std::string &);
-
-private:
-       void bind_scratch();
-public:
-       static void unbind_scratch();
+       using BufferBackend::set_debug_name;
 };
 
 } // namespace GL