with-mapped-buffer ( ..a buffer access quot: ( ..a alien -- ..b ) -- ..b )
GPU-accelerated rendering ยป Buffer objects

Prev:copy-buffer ( to-buffer-ptr: buffer-ptr from-buffer-ptr: buffer-ptr size: integer -- )
Next:with-mapped-buffer-array ( ..a buffer access c-type quot: ( ..a array -- ..b ) -- ..b )


Vocabulary
gpu.buffers

Inputs
buffera buffer
accessa buffer-access-mode
quota quotation with stack effect ( ..a alien -- ..b )


Outputs
None

Word description
Maps buffer into CPU address space with access for the dynamic extent of quot. quot is called with a pointer to the mapped memory on top of the stack.

See also
allocate-buffer, allocate-byte-array, buffer-size, update-buffer, read-buffer, copy-buffer

Definition


:: with-mapped-buffer
( ..a buffer access quot: ( ..a alien -- ..b ) -- ..b )
buffer bind-buffer :> target target access gl-access
glMapBuffer quot call target glUnmapBuffer drop ; inline