picogl.shaders.shader_uniform

Classes

UniformKind

Generic enumeration.

ShaderUniform

Module Contents

class picogl.shaders.shader_uniform.UniformKind[source]

Bases: enum.Enum

Generic enumeration.

Derive from this class to define new enumerations.

INT = 'int'[source]
FLOAT = 'float'[source]
BOOL = 'bool'[source]
VEC2 = 'vec2'[source]
VEC3 = 'vec3'[source]
VEC4 = 'vec4'[source]
MAT3 = 'mat3'[source]
MAT4 = 'mat4'[source]
class picogl.shaders.shader_uniform.ShaderUniform[source]
name: str[source]
location: int[source]
value: int | float | Sequence[float] | numpy.ndarray | bool | None = None[source]
uniform_type: UniformKind | None = None[source]
__post_init__()[source]
static infer_type(v: Any) UniformKind[source]
upload(gl_module=None) None[source]

Upload the current value to the bound GL program using PyOpenGL-like calls. If location < 0 (GL returns -1 when not found/used), this is a no-op.

  • gl_module: optional OpenGL.GL-like module. If None, will try to import PyOpenGL (from OpenGL import GL as GL) at call time.

__str__() str[source]