]> git.tdb.fi Git - libs/gl.git/blobdiff - source/buffer.cpp
Add memory-mapping functions for Buffer
[libs/gl.git] / source / buffer.cpp
index 9fa03c1242024184585618ff841b71d802fc1a46..9edcf07d6e52ab52e2b9b5f277a0f57b389fcec3 100644 (file)
@@ -61,6 +61,18 @@ BufferRange *Buffer::create_range(unsigned s, unsigned o)
        return new BufferRange(*this, s, o);
 }
 
+void *Buffer::map(BufferAccess access)
+{
+       BindRestore _bind(this, type);
+       return glMapBuffer(type, access);
+}
+
+bool Buffer::unmap()
+{
+       BindRestore _bind(this, type);
+       return glUnmapBuffer(type);
+}
+
 void Buffer::bind_to(BufferType t) const
 {
        if(t!=type)