read-buffer ( buffer-ptr: buffer-ptr size: integer -- data: byte-array )
GPU-accelerated rendering ยป Buffer objects

Prev:update-buffer ( buffer-ptr: buffer-ptr size: integer data -- )
Next:copy-buffer ( to-buffer-ptr: buffer-ptr from-buffer-ptr: buffer-ptr size: integer -- )


Vocabulary
gpu.buffers

Inputs
buffer-ptra buffer-ptr
sizean integer


Outputs
dataa byte-array


Word description
Reads size bytes from buffer into a new byte-array.

See also
allocate-buffer, allocate-byte-array, buffer-size, update-buffer, copy-buffer, with-mapped-buffer

Definition


TYPED:: read-buffer
( buffer-ptr: buffer-ptr size: integer -- data: byte-array )
buffer-ptr buffer>> :> buffer buffer bind-buffer :> target
size <byte-array> :> data target buffer-ptr offset>> size
data glGetBufferSubData data ;