allocate-buffer ( buffer size initial-data -- )
GPU-accelerated rendering ยป Buffer objects

Prev:buffer-range
Next:allocate-byte-array ( buffer byte-array -- )


Vocabulary
gpu.buffers

Inputs
buffera buffer
sizean integer
initial-dataa c-ptr or f


Outputs
None

Word description
Discards any memory currently held by buffer and reallocates a new memory block of size bytes for it. 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.

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

Definition


:: allocate-buffer ( buffer size initial-data -- )
buffer bind-buffer :> target target size initial-data buffer
gl-buffer-usage glBufferData ; inline