Buffer
- class arcade.gl.Buffer(ctx: Context, data: Optional[Any] = None, reserve: int = 0, usage: str = 'static')[source]
Bases:
object
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
arcade.gl.Context.buffer()
- Parameters
- bind_to_storage_buffer(*, binding=0, offset=0, size=- 1)[source]
Bind this buffer as a shader storage buffer.
- bind_to_uniform_block(binding: int = 0, offset: int = 0, size: int = - 1)[source]
Bind this buffer to a uniform block location. In most cases it will be sufficient to only provice a binding location.
- copy_from_buffer(source: arcade.gl.buffer.Buffer, size=- 1, offset=0, source_offset=0)[source]
Copy data into this buffer from another buffer
- delete()[source]
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)[source]
Release/delete open gl buffer. This is automatically called when the object is garbage collected.
- property glo: ctypes.c_uint
The OpenGL resource id
- Type
gl.GLuint
- orphan(size: int = - 1, double: bool = False)[source]
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 redering operations it will be deallocated by OpenGL when completed.