PokéRogue
    Preparing search index...

    Wrapper for the WebGL global state, including blend mode, texture bindings, scissor test, stencil test, depth test, and other GL context settings. It tracks the current state and applies changes efficiently to avoid redundant WebGL calls.

    Index
    renderer: WebGLRenderer

    The WebGLRenderer this WebGLGlobalWrapper is associated with.

    The current WebGL global state parameters tracked by this wrapper.

    • Sets the global WebGL state. Parameters are updated on the WebGLRenderingContext only if they are defined in the input state, and different from the current state.

      When force is true, and state is defined, parameters on state are always set, regardless of the current state.

      When force is true, and state is undefined, the current state is used to reset all the parameters.

      Parameters

      • Optionalstate: WebGLGlobalParameters

        The state to set. If undefined, the current state is used when force is true.

      • Optionalforce: boolean

        If true, the state will be set regardless of the current state. Default false.

      • OptionalvaoLast: boolean

        If true, the VAO will be set last. Otherwise, it will be set first. This is useful when performing state changes that will affect a VAO, such as bindings.elementArrayBuffer. Default false.

      Returns void

    • Updates the bindings state.

      Parameters

      • state: WebGLGlobalParameters

        The state to set.

      • Optionalforce: boolean

        If true, the state will be set regardless of the current state. Default false.

      Returns void

    • Updates the active texture unit state.

      Parameters

      • state: WebGLGlobalParameters

        The state to set.

      • Optionalforce: boolean

        If true, the state will be set regardless of the current state. Default false.

      Returns void

    • Updates the array buffer (ARRAY_BUFFER) binding state. This binds the vertex buffer object used to supply vertex attribute data to the GPU.

      Parameters

      • state: WebGLGlobalParameters

        The state to set.

      • Optionalforce: boolean

        If true, the state will be set regardless of the current state. Default false.

      Returns void

    • Updates the index array buffer state.

      Parameters

      • state: WebGLGlobalParameters

        The state to set.

      • Optionalforce: boolean

        If true, the state will be set regardless of the current state. Default false.

      Returns void

    • Updates the framebuffer state.

      Parameters

      • state: WebGLGlobalParameters

        The state to set.

      • Optionalforce: boolean

        If true, the state will be set regardless of the current state. Default false.

      Returns void

    • Updates the currently bound WebGL shader program by calling gl.useProgram.

      Parameters

      • state: WebGLGlobalParameters

        The state to set.

      • Optionalforce: boolean

        If true, the state will be set regardless of the current state. Default false.

      Returns void

    • Updates the renderbuffer state.

      Parameters

      • state: WebGLGlobalParameters

        The state to set.

      • Optionalforce: boolean

        If true, the state will be set regardless of the current state. Default false.

      Returns void

    • Updates the blend state.

      Parameters

      • state: WebGLGlobalParameters

        The state to set.

      • Optionalforce: boolean

        If true, the state will be set regardless of the current state. Default false.

      Returns void

    • Updates the blend color.

      Parameters

      • state: WebGLGlobalParameters

        The state to set.

      • Optionalforce: boolean

        If true, the state will be set regardless of the current state. Default false.

      Returns void

    • Updates the blend enabled state.

      Parameters

      • state: WebGLGlobalParameters

        The state to set.

      • Optionalforce: boolean

        If true, the state will be set regardless of the current state. Default false.

      Returns void

    • Updates the blend equation state.

      Equations are always treated as separate.

      Parameters

      • state: WebGLGlobalParameters

        The state to set.

      • Optionalforce: boolean

        If true, the state will be set regardless of the current state. Default false.

      Returns void

    • Updates the blend function state.

      Functions are always treated as separate.

      Parameters

      • state: WebGLGlobalParameters

        The state to set.

      • Optionalforce: boolean

        If true, the state will be set regardless of the current state. Default false.

      Returns void

    • Updates the RGBA color value used to fill the color buffer when gl.clear is called with the color buffer bit.

      Parameters

      • state: WebGLGlobalParameters

        The state to set.

      • Optionalforce: boolean

        If true, the state will be set regardless of the current state. Default false.

      Returns void

    • Updates the color write mask, which controls which RGBA color components are written to the color buffer during rendering.

      Parameters

      • state: WebGLGlobalParameters

        The state to set.

      • Optionalforce: boolean

        If true, the state will be set regardless of the current state. Default false.

      Returns void

    • Updates the cull face state.

      Parameters

      • state: WebGLGlobalParameters

        The state to set.

      • Optionalforce: boolean

        If true, the state will be set regardless of the current state. Default false.

      Returns void

    • Updates the depth test state.

      Parameters

      • state: WebGLGlobalParameters

        The state to set.

      • Optionalforce: boolean

        If true, the state will be set regardless of the current state. Default false.

      Returns void

    • Updates the scissor state.

      Parameters

      • state: WebGLGlobalParameters

        The state to set.

      • Optionalforce: boolean

        If true, the state will be set regardless of the current state. Default false.

      Returns void

    • Updates the scissor box state.

      Parameters

      • state: WebGLGlobalParameters

        The state to set.

      • Optionalforce: boolean

        If true, the state will be set regardless of the current state. Default false.

      Returns void

    • Updates the scissor enabled state.

      Parameters

      • state: WebGLGlobalParameters

        The state to set.

      • Optionalforce: boolean

        If true, the state will be set regardless of the current state. Default false.

      Returns void

    • Updates the stencil state.

      Parameters

      • state: WebGLGlobalParameters

        The state to set.

      • Optionalforce: boolean

        If true, the state will be set regardless of the current state. Default false.

      Returns void

    • Updates the value used to clear the stencil buffer when gl.clear is called with the stencil buffer bit.

      Parameters

      • state: WebGLGlobalParameters

        The state to set.

      • Optionalforce: boolean

        If true, the state will be set regardless of the current state. Default false.

      Returns void

    • Updates the stencil enabled state.

      Parameters

      • state: WebGLGlobalParameters

        The state to set.

      • Optionalforce: boolean

        If true, the state will be set regardless of the current state. Default false.

      Returns void

    • Updates the stencil function state.

      Parameters

      • state: WebGLGlobalParameters

        The state to set.

      • Optionalforce: boolean

        If true, the state will be set regardless of the current state. Default false.

      Returns void

    • Updates the stencil operation state.

      Parameters

      • state: WebGLGlobalParameters

        The state to set.

      • Optionalforce: boolean

        If true, the state will be set regardless of the current state. Default false.

      Returns void

    • Updates the stencil write mask state.

      Parameters

      • state: WebGLGlobalParameters

        The state to set.

      • Optionalforce: boolean

        If true, the state will be set regardless of the current state. Default false.

      Returns void

    • Updates the texturing state, which takes effect when creating a texture. This includes flipY and premultiplyAlpha.

      Parameters

      • state: WebGLGlobalParameters

        The state to set.

      • Optionalforce: boolean

        If true, the state will be set regardless of the current state. Default false.

      Returns void

    • Updates the UNPACK_FLIP_Y_WEBGL pixel store parameter, which controls whether texture image data is flipped vertically when uploaded to the GPU.

      Parameters

      • state: WebGLGlobalParameters

        The state to set.

      • Optionalforce: boolean

        If true, the state will be set regardless of the current state. Default false.

      Returns void

    • Updates the UNPACK_PREMULTIPLY_ALPHA_WEBGL pixel store parameter, which controls whether the alpha channel is pre-multiplied into the RGB components when texture image data is uploaded to the GPU.

      Parameters

      • state: WebGLGlobalParameters

        The state to set.

      • Optionalforce: boolean

        If true, the state will be set regardless of the current state. Default false.

      Returns void

    • Updates the vertex array object state.

      Note that the VAO is automatically affected by bindings of elementArrayBuffer and any attribute settings, as written in WebGL. When binding the VAO, ensure that other bindings come before or after, as you intend. When using update, the VAO is set first by default.

      Parameters

      • state: WebGLGlobalParameters

        The state to set.

      • Optionalforce: boolean

        If true, the state will be set regardless of the current state. Default false.

      Returns void

    • Updates the viewport state.

      Parameters

      • state: WebGLGlobalParameters

        The state to set.

      • Optionalforce: boolean

        If true, the state will be set regardless of the current state. Default false.

      Returns void