picogl.backend.gl.api.glcleanup
This module provides helper functions for safely deleting OpenGL buffer objects, including vertex buffer objects (VBOs), vertex array objects (VAOs), and dictionaries of buffer handles. It ensures proper resource cleanup and avoids memory leaks in graphics applications.
Dependencies:
OpenGL (PyOpenGL)
picogl.backend.modern.core.vertex.base (for VertexBuffer type)
Functions:
Usage Example:
delete_buffer_object(my_vertex_buffer)
delete_vao(my_vao_id)
delete_dict_buffers(buffer_map)
Functions
|
True when OpenGL deletes are safe (current, valid context). |
|
Delete a VAO and any VBOs/EBO registered on it (context-safe no-op if none). |
|
delete_dict_buffers |
|
delete_buffer_object |
|
gl_delete_buffers |
|
delete_vao |
Module Contents
- picogl.backend.gl.api.glcleanup._gl_context_ok() bool[source]
True when OpenGL deletes are safe (current, valid context).
- picogl.backend.gl.api.glcleanup.gl_release_vertex_array_object(vao: Any) None[source]
Delete a VAO and any VBOs/EBO registered on it (context-safe no-op if none).
- picogl.backend.gl.api.glcleanup.gl_delete_dict_buffers(buffer_dict: Dict[str, int]) None[source]
delete_dict_buffers
- Parameters:
buffer_dict
- Returns:
- picogl.backend.gl.api.glcleanup.gl_delete_buffer_object(buffer: VertexBuffer | None) None[source]
delete_buffer_object
- Parameters:
buffer – Optional[int]
- Returns:
None