picogl.shaders.registry
Example Usage:
>>> shader_registry = ShaderRegistry()
... # Load shaders at app start
... for shader_type_value in ShaderType:
... shader_registry.load_and_add(shader_type_value)
...
... # Later...
... program = shader_registry.get(ShaderType.ATOMS)
... if program:
... program.bind()
Classes
Compile and cache |
Module Contents
- class picogl.shaders.registry.ShaderRegistry[source]
Compile and cache
ShaderPrograminstances byShaderType.- shaders: Dict[picogl.shaders.type.ShaderType, picogl.backend.modern.core.shader.program.ShaderProgram][source]
- shader_directory: str | pathlib.Path[source]
- load_and_add(shader_type: picogl.shaders.type.ShaderType) picogl.backend.modern.core.shader.program.ShaderProgram | None[source]
Load, compile, and register a shader program for shader_type.
- get(shader_type: picogl.shaders.type.ShaderType) picogl.backend.modern.core.shader.program.ShaderProgram | None[source]
- has(shader_type: picogl.shaders.type.ShaderType) bool[source]