picogl.gpu.buffers.vertex.legacy ================================ .. py:module:: picogl.gpu.buffers.vertex.legacy .. autoapi-nested-parse:: 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 ------- .. autoapisummary:: picogl.gpu.buffers.vertex.legacy.VertexBufferGroup Module Contents --------------- .. py:class:: VertexBufferGroup(draw_mode: picogl.backend.gl.enums.GLDrawMode = GLDrawMode.LINE_STRIP) Bases: :py:obj:`picogl.gpu.buffers.base.VertexBase` Container for legacy VBOs, mimicking VAO interface. .. py:attribute:: LEGACY_ATTR_BINDINGS .. py:attribute:: _index_count :value: None .. py:attribute:: handle :value: 0 .. py:attribute:: layout :type: Optional[picogl.gpu.buffers.attributes.LayoutDescriptor] :value: None .. py:attribute:: named_vbos :type: dict[picogl.gpu.buffers.vertex.aliases.VertexBufferRole | str, picogl.backend.legacy.core.vertex.buffer.vertex.LegacyVBO] .. py:attribute:: draw_mode :type: picogl.backend.gl.enums.GLDrawMode .. py:attribute:: vbo_classes .. py:method:: __del__() .. py:property:: vbo :type: Optional[picogl.backend.legacy.core.vertex.buffer.position.LegacyPositionVBO | int] .. py:property:: cbo :type: Optional[picogl.backend.legacy.core.vertex.buffer.color.LegacyColorVBO | int] .. py:property:: nbo :type: Optional[picogl.backend.legacy.core.vertex.buffer.normal.LegacyNormalVBO | int] .. py:property:: ebo :type: Optional[picogl.backend.legacy.core.vertex.buffer.element.LegacyEBO | int] .. py:method:: _set_named_vbo(role: picogl.gpu.buffers.vertex.aliases.VertexBufferRole, value: Optional[picogl.backend.legacy.core.vertex.buffer.vertex.LegacyVBO | int]) -> None .. py:method:: add_vbo_object(name: str, vbo: picogl.backend.legacy.core.vertex.buffer.vertex.LegacyVBO) -> picogl.backend.legacy.core.vertex.buffer.vertex.LegacyVBO Register a VBO by semantic name or shorthand alias. .. py:method:: get_vbo_object(name: str) -> picogl.backend.legacy.core.vertex.buffer.vertex.LegacyVBO Retrieve a VBO by its semantic or shorthand name. .. py:method:: delete() -> None Release resources (VAO or equivalent). .. py:property:: index_count :type: int Return the number of indices in the EBO. :return: int .. py:method:: draw(index_count: int = 0, mode: picogl.backend.gl.enums.GLDrawMode | None = None) draw :param index_count: int :param mode: int Enable legacy client states, bind VBOs, draw, and clean up. .. py:method:: add_vbo(name: str, data: numpy.ndarray, size: int = 3, dtype: int = GLNumeric.FLOAT, handle: int | None = None) -> Any Create and register a VBO with explicit parameters. .. py:method:: get_buffer_class(name: str = VBOType.VBO) -> type[picogl.backend.legacy.core.vertex.buffer.vertex.LegacyVBO] get_buffer_class :param name: str :return: LegacyVBO .. py:method:: add_ebo(name: str = VBOType.EBO, data: numpy.ndarray = None) add_ebo :param name: str :param data: np.ndarray .. py:method:: _bind_ebo() .. py:method:: _bind_ebo_id(ebo_id: Any | None) .. py:method:: _unbind_ebo() .. py:method:: set_layout(layout: picogl.gpu.buffers.attributes.LayoutDescriptor) -> None Define the attribute layout for this VAO/group. .. py:method:: _resolve_client_states() -> tuple[picogl.backend.gl.state.client.GLClientState, Ellipsis] Return legacy client states to enable for the current layout. .. py:method:: _buffer_handle(vbo: picogl.backend.legacy.core.vertex.buffer.vertex.LegacyVBO | int) -> int .. py:method:: bind() -> None Bind buffers and configure legacy OpenGL client arrays. .. py:method:: _do_binding() do binding .. py:method:: unbind() -> None Disable attribute arrays and unbind the array buffer. .. py:method:: _do_unbinding() .. py:method:: __enter__() Context manager entry - bind the VBO. .. py:method:: __exit__(exc_type, exc_val, exc_tb) Context manager exit - unbind the VBO.