Handbook
Glossary
grow-buffer ( buffer: buffer target-size: integer -- )
GPU-accelerated rendering
ยป
Buffer objects
Prev:
allocate-byte-array ( buffer byte-array -- )
Next:
update-buffer ( buffer-ptr: buffer-ptr size: integer data -- )
Vocabulary
gpu
.
buffers
Inputs
buffer
a
buffer
target-size
an
integer
Outputs
None
Word description
If the
buffer-size
of the given
buffer
is less than
target-size
, reallocates the buffer to a size large enough to accommodate
target-size
bytes. If the buffer is reallocated, the original contents are lost.
Definition
USING:
kernel
math
typed
;
IN:
gpu.buffers
TYPED:
grow-buffer
( buffer: buffer target-size: integer -- )
over
buffer-size
2dup
>
[
(grow-buffer-size)
f
allocate-buffer
]
[
3drop
]
if
;
inline