picogl.renderer.glresourceregistry

GL Resource Registry

Holds OpenGL-related state (VAOs, shaders, textures, transform matrices) and tracks resources per Qt / GL context when PySide6 is already in use.

Heavy deps (VertexArrayObject, ShaderProgram, PySide6) are not imported at module load so GLUT examples stay free of Qt / NumPy-shiboken warnings.

Attributes

T

Classes

GLResourceRegistry

OpenGL resource registry and render-state holder.

Functions

_current_qt_context()

Return the current Qt GL context if PySide6 is already imported.

Module Contents

picogl.renderer.glresourceregistry.T[source]
picogl.renderer.glresourceregistry._current_qt_context()[source]

Return the current Qt GL context if PySide6 is already imported.

Does not import PySide6 itself — GLUT paths must stay Qt-free.

class picogl.renderer.glresourceregistry.GLResourceRegistry[source]

OpenGL resource registry and render-state holder.

_creation_context = None[source]
_contexts[source]
_cache: dict[object, object][source]
_creation_thread_id[source]
vaos: dict[str, picogl.backend.modern.core.vertex.array.object.VertexArrayObject][source]
current_vao: picogl.backend.modern.core.vertex.array.object.VertexArrayObject | None = None[source]
shader: picogl.backend.modern.core.shader.program.ShaderProgram | None = None[source]
shader_type: picogl.shaders.ShaderType[source]
textures: dict[str, int][source]
active_texture: str | None = None[source]
texture_id: int | None = None[source]
model_matrix[source]
view_matrix[source]
projection_matrix[source]
mvp_matrix[source]
eye_position[source]
eye_np[source]
projection = None[source]
view = None[source]
eye = None[source]
center = None[source]
up = None[source]
create_shader_program(vertex_source_file: str, fragment_source_file: str, glsl_dir: str | pathlib.Path | None = None) → None[source]

Compile and store a vertex/fragment shader program on this registry.

property context[source]
_get_bucket(ctx)[source]
register(ctx, resource_type: str, resource)[source]
unregister(ctx, resource_type: str, resource)[source]
get_context_resources(ctx)[source]
validate_context()[source]
get_context_key(ctx)[source]
get_or_create(key: object, factory: Callable[[], T]) → T[source]

Return a cached GL resource, creating it with factory if needed.