picogl.buffers.vertex.legacy

VertexArrayGroup

Legacy backend (no real GL VAO support)

Classes

VertexBufferGroup

Container for legacy VBOs, mimicking VAO interface.

Module Contents

class picogl.buffers.vertex.legacy.VertexBufferGroup(draw_mode: int = GL_LINE_STRIP)[source]

Bases: picogl.buffers.base.VertexBase

Container for legacy VBOs, mimicking VAO interface.

_index_count = None[source]
handle = 0[source]
vao = None[source]
vbo = None[source]
cbo = None[source]
nbo = None[source]
ebo = None[source]
layout: picogl.buffers.attributes.LayoutDescriptor | None = None[source]
named_vbos: dict[str, picogl.backend.legacy.core.vertex.buffer.vertex.LegacyVBO][source]
draw_mode: int[source]
vbo_classes[source]
__del__()[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: int = GL_POINTS)[source]

draw

Parameters:
  • index_count

  • 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 = GL_FLOAT, handle: int | None = None) Any[source]

Create and register a VBO with explicit parameters.

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

get_buffer_class

Parameters:

name – str

Returns:

LegacyVBO

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

add_ebo

Parameters:
  • name – str

  • data – np.ndarray

draw_elements(count: int = 0, mode: int = GL_TRIANGLES, dtype: int = GL_UNSIGNED_INT, offset: int = 0)[source]

Draw using an element buffer (EBO) with legacy client states.

Parameters:
  • count – Number of indices to draw. Defaults to self.index_count.

  • mode – OpenGL primitive type (GL_TRIANGLES, GL_LINES, etc.).

  • dtype – Data type of indices (GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT, GL_UNSIGNED_INT).

  • offset – Byte offset into the EBO.

set_layout(layout: picogl.buffers.attributes.LayoutDescriptor) None[source]

Define the attribute layout for this VAO/group.

bind() None[source]

Bind buffers and upload attribute pointers per stored layout.

unbind() None[source]

Disable attribute arrays and unbind the array buffer.

__enter__()[source]

Context manager entry - bind the VBO.

__exit__(exc_type, exc_val, exc_tb)[source]

Context manager exit - unbind the VBO.