byte-array>buffer ( byte-array upload: buffer-upload-pattern usage: buffer-usage-pattern kind: buffer-kind -- buffer: buffer )
GPU-accelerated rendering > Buffer objects

Prev:<buffer> ( upload: buffer-upload-pattern usage: buffer-usage-pattern kind: buffer-kind size: integer initial-data -- buffer: buffer )
Next:buffer-kind


Vocabulary
gpu.buffers

Inputs and outputs
byte-arraya byte-array
uploada buffer-upload-pattern
usagea buffer-usage-pattern
kinda buffer-kind
buffera buffer


Word description
Allocates a new buffer object with the size and contents of byte-array. 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: byte-array>buffer
( byte-array upload: buffer-upload-pattern usage: buffer-usage-pattern kind: buffer-kind -- buffer: buffer )
[ ] 3curry dip [ byte-length ] [ ] bi <buffer> ;