<buffer> ( upload: buffer-upload-pattern usage: buffer-usage-pattern kind: buffer-kind size: integer initial-data -- buffer: buffer )
GPU-accelerated rendering > Buffer objects

Prev:buffer
Next:byte-array>buffer ( byte-array upload: buffer-upload-pattern usage: buffer-usage-pattern kind: buffer-kind -- buffer: buffer )


Vocabulary
gpu.buffers

Inputs and outputs
uploada buffer-upload-pattern
usagea buffer-usage-pattern
kinda buffer-kind
sizean integer
initial-dataa c-ptr or f
buffera buffer


Word description
Allocates a new buffer object of size bytes. If initial-data is not f, size bytes are copied from initial-data into the buffer to initialize it; otherwise, the buffer content is left uninitialized. upload, usage, and kind provide hints to the implementation about the expected usage pattern of the buffer as documented in the buffer class documentation.

Definition


TYPED: <buffer>
( upload: buffer-upload-pattern usage: buffer-usage-pattern kind: buffer-kind size: integer initial-data -- buffer: buffer )
[ [ gen-gl-buffer ] 3dip buffer boa dup ] 2dip
allocate-buffer window-resource ;