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

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


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

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


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