picogl.backend.modern.core.vertex.buffer.element

Element Buffer Object (EBO) Management for Modern OpenGL Rendering.

This module defines the ElementBufferObject class, which encapsulates the OpenGL element data buffer (also known as an index buffer). It is used to store indices that OpenGL uses to decide which vertices to draw, allowing for efficient reuse of vertex data in complex models.

The class handles: - Creation and deletion of the EBO on the GPU. - Binding and unbinding of the buffer. - Storage of element/index data along with configuration parameters. - Uploading the data to the GPU with glBufferData.

Example usage:

>>>ebo = ModernEBO(data=data) …ebo.bind() …ebo.set_element_attributes(indices, indices.nbytes) …ebo.configure() …ebo.unbind()

Classes

ModernEBO

OpenGL element data buffer (also known as an index buffer)

Module Contents

class picogl.backend.modern.core.vertex.buffer.element.ModernEBO(handle: int | None = None, data: numpy.ndarray | None = None, size: int = 3, target: int = GL_ELEMENT_ARRAY_BUFFER)[source]

Bases: picogl.backend.modern.core.vertex.base.VertexBuffer

OpenGL element data buffer (also known as an index buffer)

set_element_attributes(data: numpy.ndarray, size: int, dtype: int = GL_STATIC_DRAW)[source]

set_element_attributes

Parameters:
  • data – np.ndarray

  • size – int

  • dtype – int

Returns:

None

configure()[source]

configure

Returns:

None