#include <buffer_object.hpp>
Inherits zmol::noncopyable_::noncopyable.
List of all members.
Detailed Description
RAII-style class for mapping the buffer object contents to the local address space. Example usage:
buffer_object buf(GL_ARRAY_BUFFER, GL_STATIC_DRAW);
buf.resize(4096);
{
void *ptr = map.get_mapped_pointer();
}
Constructor & Destructor Documentation
zmol::buffer_object_mapping::buffer_object_mapping |
( |
buffer_object & |
p_bufobj, |
|
|
GLenum const |
p_access |
|
) |
| |
|
explicit |
Constructor. Maps the entire buffer object data to the local address space using glMapBufferRange().
- Parameters:
-
p_bufobj | Buffer object whose data shall be mapped |
p_access | See the OpenGL glMapBufferRange() documentation for an explanation of this value |
zmol::buffer_object_mapping::buffer_object_mapping |
( |
buffer_object & |
p_bufobj, |
|
|
GLenum const |
p_access, |
|
|
GLintptr const |
p_offset, |
|
|
GLsizeiptr |
p_length |
|
) |
| |
|
explicit |
Constructor. Maps a subset of the buffer object data to the local address space using glMapBufferRange().
- Parameters:
-
p_bufobj | Buffer object whose data shall be mapped |
p_access | See the OpenGL glMapBufferRange() documentation for an explanation of this value |
p_offset | Offset within the buffer object data, in bytes; the mapping will start at this offset |
p_length | Length of the buffer object data to map, in bytes; the mapping will be valid for this amount of bytes |
zmol::buffer_object_mapping::~buffer_object_mapping |
( |
| ) |
|
Destructor. Unmaps the buffer object data by using glUnmapBuffer().
Member Function Documentation
void zmol::buffer_object_mapping::flush_entire_range |
( |
| ) |
|
Explicitely flush the entire mapped range. See the OpenGL glMapBufferRange() documentation for details about explicit flushing. This call is necessary only if explicit flushing was enabled in the constructor's access argument.
void zmol::buffer_object_mapping::flush_subrange |
( |
GLintptr const |
p_offset, |
|
|
GLsizeiptr |
p_length |
|
) |
| |
Explicitely flush a subrange. See the OpenGL glMapBufferRange() documentation for details about explicit flushing. This call is necessary only if explicit flushing was enabled in the constructor's access argument.
- Parameters:
-
p_offset | Offset, in bytes, of the region to flush |
p_length | Length, in bytes, of the region to flush |
void * zmol::buffer_object_mapping::get_mapped_pointer |
( |
| ) |
|
Returns the pointer to the mapped data.
void const * zmol::buffer_object_mapping::get_mapped_pointer |
( |
| ) |
const |
Returns the pointer to the mapped data.