]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/buffer.h
Use size_t to store sizes of buffers and such
[libs/gl.git] / source / core / buffer.h
index 9737a2ea9323ddd0af5c44b3d51d595eff6fc6d1..810bfc1a56253e181f7cc55b5d228c3441e99fee 100644 (file)
@@ -15,8 +15,6 @@ 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
@@ -27,14 +25,12 @@ class Buffer: public BufferBackend
        friend BufferBackend;
 
 private:
-       unsigned size;
+       std::size_t size = 0;
 
 public:
-       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);
+       void storage(std::size_t);
 
        /** Uploads data into the buffer, completely replacing any previous
        contents.  Storage must be defined beforehand.  The data must have size
@@ -43,11 +39,11 @@ public:
 
        /** Overwrites part of the buffer data with new data.  Storage must be
        defined beforehand. */
-       void sub_data(unsigned, unsigned, const void *);
+       void sub_data(std::size_t, std::size_t, const void *);
 
-       unsigned get_size() const { return size; }
+       std::size_t get_size() const { return size; }
 
-       void require_size(unsigned) const;
+       void require_size(std::size_t) const;
 
        using BufferBackend::map;
        using BufferBackend::unmap;