picogl.backend.state
Render-state descriptors and command helpers for PicoGL backends.
The classes in this module are intentionally backend-neutral: they describe desired OpenGL state and delegate the actual gl calls to a backend object.
Classes
Raster State |
|
Tracks capability state without querying OpenGL. |
|
Blend State |
|
Depth State |
|
Flat render-state descriptor with nested-state constructor support. |
|
Applies render-state deltas through a gl backend. |
|
gl Attribute Array |
|
Test gl Mesh |
|
Draw Command |
|
gl Clipping Plane State |
Functions
|
Return a raw OpenGL value for PicoGL enums or pass raw values through. |
Module Contents
- picogl.backend.state.gl_value(value: Any) Any[source]
Return a raw OpenGL value for PicoGL enums or pass raw values through.
- class picogl.backend.state.GLStateManager(backend: CapabilityDriver)[source]
Tracks capability state without querying OpenGL.
- class picogl.backend.state.BlendState[source]
Blend State
- apply(state: GLStateManager)[source]
- class picogl.backend.state.DepthState(test: bool = True, write: bool = True, enabled: bool | None = None)[source]
Depth State
- apply(state: GLStateManager)[source]
- class picogl.backend.state.RenderState(*, raster: RasterState | None = None, depth: DepthState | None = None, blend: BlendState | bool | None = None, blend_src: Any = GLBlendFactor.SRC_ALPHA, blend_dst: Any = GLBlendFactor.ONE_MINUS_SRC_ALPHA, depth_test: bool | None = None, depth_write: bool | None = None, line_width: float | None = None, polygon_mode: Any | None = None, polygon_offset: tuple[float, float] | None = None, point_size: float | None = None, program_point_size: bool = False, cull_face: bool = False, lighting: bool = False)[source]
Flat render-state descriptor with nested-state constructor support.
- property raster: RasterState[source]
- property depth: DepthState[source]
- property blend_state: BlendState[source]
- class picogl.backend.state.RenderStateApplier(backend: Any)[source]
Applies render-state deltas through a gl backend.
- current: RenderState | None = None[source]
- apply(state: RenderState)[source]
- class picogl.backend.state.GLVertexBuffer(data: numpy.ndarray)[source]
- class picogl.backend.state.TestGLMesh(vertices, indices=None)[source]
Test gl Mesh
- attributes: list[GLAttributeArray] = [][source]
- add_attribute(attr: GLAttributeArray)[source]