#include
<oglplus/buffer_map.hpp>
The BufferRawMap
allows to map the contents of a GPU
buffer into the client's address space.
class BufferRawMap { public: BufferRawMap( BufferTarget target, BufferSize offset, BufferSize size, Bitfield<BufferMapAccess> access ); BufferRawMap( BufferTarget target, Bitfield<BufferMapAccess> access ); BufferRawMap(const BufferRawMap&) = delete; BufferRawMap(BufferRawMap&&); ~BufferRawMap(void); void Unmap(void); bool Mapped(void) const; GLsizeiptr Size(void) const; const GLvoid* RawData(void) const; GLvoid* RawData(void); void FlushRange(BufferSize offset, BufferSize length); };
Maps a range (specified by |
|
Maps the whole buffer currently bound to the specified |
|
Buffer maps are not copyable. |
|
Buffer maps are moveable. |
|
Unmaps the buffer from client address space (if mapped). See |
|
Returns true if the buffer is mapped. |
|
Returns the size (in bytes) of the mapped buffer. |
|
Returns a raw pointer to the mapped data. Note that the buffer has to be mapped or the result is undefined. |
|
Indicate modifications to a mapped buffer range. Note that the buffer
has to be mapped or the result is undefined. See |
template <typename Type> class BufferTypedMap : public BufferRawMap { public: BufferTypedMap( BufferTarget target, BufferTypedSize<Type> offset, BufferTypedSize<Type> size, Bitfield<BufferMapAccess> access ) BufferTypedMap( BufferTarget target, Bitfield<BufferMapAccess> access ); GLsizeiptr Count(void) const; const Type* Data(void) const; Type* Data(void); const Type& At(GLuint index) const; Type& At(GLuint index); void FlushElements( BufferTypedSize<Type> start, BufferTypedSize<Type> count ); };
Maps a range (specified by |
|
Maps the whole buffer currently bound to the specified |
|
Returns the count of elements of |
|
Returns a typed pointer to the mapped data. Note that the buffer has to be mapped or the result is undefined. |
|
Returns a reference to the element at the specified |
|
Indicate modifications to a mapped range of elements of |
#include
<oglplus/buffer_map_access.hpp>
enum class BufferMapAccess : GLbitfield { Read = GL_MAP_READ_BIT, Write = GL_MAP_WRITE_BIT, Persistent = GL_MAP_PERSISTENT_BIT, Coherent = GL_MAP_COHERENT_BIT, InvalidateRange = GL_MAP_INVALIDATE_RANGE_BIT, InvalidateBuffer = GL_MAP_INVALIDATE_BUFFER_BIT, FlushExplicit = GL_MAP_FLUSH_EXPLICIT_BIT, Unsynchronized = GL_MAP_UNSYNCHRONIZED_BIT }; template <> Range<BufferMapAccess> EnumValueRange<BufferMapAccess>(void); StrCRef EnumValueName(BufferMapAccess); Bitfield<BufferMapAccess> operator | (BufferMapAccess b1, BufferMapAccess b2);