picogl.protocols

Submodules

Attributes

DrawableLengthInput

Classes

BufferContainer

Wrapper or group holding nested VAO/VBO handles (e.g. ElMo buffer groups).

DrawableBuffer

Protocol for OpenGL buffer/VAO objects that can be bound, drawn, and deleted.

VertexBufferDataSource

Single legacy/modern VBO or EBO with CPU-side data.

Package Contents

class picogl.protocols.BufferContainer[source]

Bases: Protocol

Wrapper or group holding nested VAO/VBO handles (e.g. ElMo buffer groups).

vao: DrawableBuffer | int | None
vbo: VertexBufferDataSource | int | None
named_vbos: Mapping[Any, VertexBufferDataSource]
index_count: int
class picogl.protocols.DrawableBuffer[source]

Bases: Protocol

Protocol for OpenGL buffer/VAO objects that can be bound, drawn, and deleted.

Implementors must provide bind(), unbind(), draw(), and delete(). Optional: is_valid() for validity checks; __enter__/__exit__ for context-manager support (with obj: obj.draw()).

Legacy VBO groups and modern VAOs (VertexArrayObject, RibbonVBG, etc.) conform to this protocol.

bind() → None[source]

Bind this buffer/VAO for rendering.

unbind() → None[source]

Unbind this buffer/VAO after rendering.

draw(*args: Any, **kwargs: Any) → None[source]

Issue draw calls. Signature is backend-specific (e.g. atom_count, index_count).

delete() → None[source]

Release GPU resources.

data_length() → int[source]

Number of vertices (or drawable elements) in this buffer.

type picogl.protocols.DrawableLengthInput = DrawableBuffer | BufferContainer | VertexBufferDataSource | None[source]
class picogl.protocols.VertexBufferDataSource[source]

Bases: Protocol

Single legacy/modern VBO or EBO with CPU-side data.

data: numpy.ndarray | None