gameforge - v0.1.12
    Preparing search index...

    Class StateSystem

    System plugin to the renderer to manage WebGL state machines.

    PIXI

    Implements

    Index

    Constructors

    • Returns StateSystem

    Properties

    _blendEq: boolean

    Whether current blend equation is different

    blendMode: BLEND_MODES | -1

    Blend mode

    PIXI.BLEND_MODES.NONE
    @readonly
    blendModes: number[][]
    checks: ((system: this, state: State) => void)[]

    Collection of check calls

    defaultState: State

    Default WebGL State

    GL context

    map: ((value: boolean) => void)[]

    Collection of calls

    polygonOffset: number

    Polygon offset

    stateId: number

    State ID

    Methods

    • Sets the state, when previous state is unknown.

      Parameters

      • state: State

        The state to set

      Returns void

    • Resets all the logic and disables the VAOs.

      Returns void

    • Sets the current state

      Parameters

      • state: State

        The state to set.

      Returns void

    • Sets whether to enable or disable blending.

      Parameters

      • value: boolean

        Turn on or off WebGl blending.

      Returns void

    • Sets the blend mode.

      Parameters

      • value: number

        The blend mode to set to.

      Returns void

    • Sets whether to enable or disable cull face.

      Parameters

      • value: boolean

        Turn on or off webgl cull face.

      Returns void

    • Sets whether to enable or disable depth mask.

      Parameters

      • value: boolean

        Turn on or off webgl depth mask.

      Returns void

    • Sets whether to enable or disable depth test.

      Parameters

      • value: boolean

        Turn on or off webgl depth testing.

      Returns void

    • Sets the gl front face.

      Parameters

      • value: boolean

        true is clockwise and false is counter-clockwise

      Returns void

    • Sets whether to enable or disable polygon offset fill.

      Parameters

      • value: boolean

        Turn on or off webgl polygon offset testing.

      Returns void

    • Sets the polygon offset.

      Parameters

      • value: number

        the polygon offset

      • scale: number

        the polygon offset scale

      Returns void

    • Checks to see which updates should be checked based on which settings have been activated.

      For example, if blend is enabled then we should check the blend modes each time the state is changed or if polygon fill is activated then we need to check if the polygon offset changes. The idea is that we only check what we have too.

      Parameters

      • func: (system: this, state: State) => void

        the checking function to add or remove

      • value: boolean

        should the check function be added or removed.

      Returns void