Cogl.buffer_map
function buffer_map(buffer: Cogl.Buffer, access: Cogl.BufferAccess, hints: Cogl.BufferMapHint): void { // Gjs wrapper for cogl_buffer_map() }
Maps the buffer into the application address space for direct access. This is equivalent to calling Cogl.buffer_map_range with zero as the offset and the size of the entire buffer as the size.
It is strongly recommended that you pass Cogl.BufferMapHint. as a hint if you are going to replace all the buffer's data. This way if the buffer is currently being used by the GPU then the driver won't have to stall the CPU and wait for the hardware to finish because it can instead allocate a new buffer to map.
The behaviour is undefined if you access the buffer in a way conflicting with the access mask you pass. It is also an error to release your last reference while the buffer is mapped.
Since 1.2
- buffer
a buffer object
- access
how the mapped buffer will be used by the application
- hints
A mask of Cogl.BufferMapHint<!-- -->s that tell Cogl how the data will be modified once mapped.
- Returns
A pointer to the mapped memory or null is the call fails