picogl.gpu.buffers.vertex.legacy

This module provides the VertexBufferGroup class, which is a container for legacy VBOs that mimics the VAO interface. It supports the creation, management, binding, and drawing of vertex buffer objects (VBOs) and element buffer objects (EBOs).

Classes: - VertexBufferGroup: Manages various VBOs and provides functionality for

adding, accessing, and drawing vertex buffer data.

Classes

VertexBufferGroup

Container for legacy VBOs, mimicking VAO interface.

Module Contents

class picogl.gpu.buffers.vertex.legacy.VertexBufferGroup(draw_mode: picogl.backend.gl.enums.GLDrawMode = GLDrawMode.LINE_STRIP)[source]

Bases: picogl.gpu.buffers.base.VertexBase

Container for legacy VBOs, mimicking VAO interface.

LEGACY_ATTR_BINDINGS[source]
_index_count = None[source]
handle = 0[source]
layout: picogl.gpu.buffers.attributes.LayoutDescriptor | None = None[source]
named_vbos: dict[picogl.gpu.buffers.vertex.aliases.VertexBufferRole | str, picogl.backend.legacy.core.vertex.buffer.vertex.LegacyVBO][source]
draw_mode: picogl.backend.gl.enums.GLDrawMode[source]
vbo_classes[source]
__del__()[source]
property vbo: picogl.backend.legacy.core.vertex.buffer.position.LegacyPositionVBO | int | None[source]
property cbo: picogl.backend.legacy.core.vertex.buffer.color.LegacyColorVBO | int | None[source]
property nbo: picogl.backend.legacy.core.vertex.buffer.normal.LegacyNormalVBO | int | None[source]
property ebo: picogl.backend.legacy.core.vertex.buffer.element.LegacyEBO | int | None[source]
_set_named_vbo(role: picogl.gpu.buffers.vertex.aliases.VertexBufferRole, value: picogl.backend.legacy.core.vertex.buffer.vertex.LegacyVBO | int | None) None[source]
add_vbo_object(name: str, vbo: picogl.backend.legacy.core.vertex.buffer.vertex.LegacyVBO) picogl.backend.legacy.core.vertex.buffer.vertex.LegacyVBO[source]

Register a VBO by semantic name or shorthand alias.

get_vbo_object(name: str) picogl.backend.legacy.core.vertex.buffer.vertex.LegacyVBO[source]

Retrieve a VBO by its semantic or shorthand name.

delete() None[source]

Release resources (VAO or equivalent).

property index_count: int[source]

Return the number of indices in the EBO.

Returns:

int

draw(index_count: int = 0, mode: picogl.backend.gl.enums.GLDrawMode | None = None)[source]

draw

Parameters:
  • index_count – int

  • mode – int

Enable legacy client states, bind VBOs, draw, and clean up.

add_vbo(name: str, data: numpy.ndarray, size: int = 3, dtype: int = GLNumeric.FLOAT, handle: int | None = None) Any[source]

Create and register a VBO with explicit parameters.

get_buffer_class(name: str = VBOType.VBO) type[picogl.backend.legacy.core.vertex.buffer.vertex.LegacyVBO][source]

get_buffer_class

Parameters:

name – str

Returns:

LegacyVBO

add_ebo(name: str = VBOType.EBO, data: numpy.ndarray = None)[source]

add_ebo

Parameters:
  • name – str

  • data – np.ndarray

_bind_ebo()[source]
_bind_ebo_id(ebo_id: Any | None)[source]
_unbind_ebo()[source]
set_layout(layout: picogl.gpu.buffers.attributes.LayoutDescriptor) None[source]

Define the attribute layout for this VAO/group.

_resolve_client_states() tuple[picogl.backend.gl.state.client.GLClientState, Ellipsis][source]

Return legacy client states to enable for the current layout.

_buffer_handle(vbo: picogl.backend.legacy.core.vertex.buffer.vertex.LegacyVBO | int) int[source]
bind() None[source]

Bind buffers and configure legacy OpenGL client arrays.

_do_binding()[source]

do binding

unbind() None[source]

Disable attribute arrays and unbind the array buffer.

_do_unbinding()[source]
__enter__()[source]

Context manager entry - bind the VBO.

__exit__(exc_type, exc_val, exc_tb)[source]

Context manager exit - unbind the VBO.