- class arcade.gl.Buffer(ctx: Context, data: Optional[Any] = None, reserve: int = 0, usage: str = 'static')#
OpenGL buffer object. Buffers store byte data and upload it to graphics memory so shader programs can process the data. They are used for storage of vertex data, element data (vertex indexing), uniform block data etc.
Buffer objects should be created using
Destroy the underlying OpenGL resource. Don’t use this unless you know exactly what you are doing.
- static delete_glo(ctx: Context, glo: ctypes.c_uint)#
Release/delete open gl buffer. This is automatically called when the object is garbage collected.
- read(size: int = - 1, offset: int = 0) bytes #
Read data from the buffer.
- write(data: Any, offset: int = 0)#
Write byte data to the buffer.
- copy_from_buffer(source: arcade.gl.buffer.Buffer, size=- 1, offset=0, source_offset=0)#
Copy data into this buffer from another buffer
- orphan(size: int = - 1, double: bool = False)#
Re-allocate the entire buffer memory. This can be used to resize a buffer or for re-specification (orphan the buffer to avoid blocking).
If the current buffer is busy in rendering operations it will be deallocated by OpenGL when completed.
- bind_to_uniform_block(binding: int = 0, offset: int = 0, size: int = - 1)#
Bind this buffer to a uniform block location. In most cases it will be sufficient to only provide a binding location.