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)
DYNAMIC_COPY = GL_DYNAMIC_COPY
};
+enum BufferAccess
+{
+ READ_ONLY = GL_READ_ONLY,
+ WRITE_ONLY = GL_WRITE_ONLY,
+ READ_WRITE = GL_READ_WRITE
+};
+
class BufferRange;
/**
BufferRange *create_range(unsigned, unsigned);
+ void *map(BufferAccess);
+ bool unmap();
+
/** Binds the buffer in its default slot. */
void bind() const { bind_to(type); }