copy-buffer ( to-buffer-ptr: buffer-ptr from-buffer-ptr: buffer-ptr size: integer -- )
GPU-accelerated rendering > Buffer objects

Prev:read-buffer ( buffer-ptr: buffer-ptr size: integer -- data: byte-array )
Next:with-mapped-buffer ( ..a buffer access quot: ( ..a alien -- ..b ) -- ..b )


Vocabulary
gpu.buffers

Inputs and outputs
to-buffer-ptra buffer-ptr
from-buffer-ptra buffer-ptr
sizean integer


Word description
Instructs the GPU to asynchronously copy size bytes from from-buffer-ptr into to-buffer-ptr.

Notes
This word requires that the graphics context support OpenGL 3.1 or the GL_ARB_copy_buffer extension.

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

Definition


TYPED:: copy-buffer
( to-buffer-ptr: buffer-ptr from-buffer-ptr: buffer-ptr size: integer -- )
GL_COPY_WRITE_BUFFER to-buffer-ptr buffer>> glBindBuffer
GL_COPY_READ_BUFFER from-buffer-ptr buffer>> glBindBuffer
GL_COPY_READ_BUFFER GL_COPY_WRITE_BUFFER from-buffer-ptr
offset>> to-buffer-ptr offset>> size glCopyBufferSubData ;