Skip to main content
Version: Phaser v4.0.0-rc.6

WebGLGlobalWrapper

Wrapper for the WebGL global state.

Constructor

new WebGLGlobalWrapper(renderer)

Parameters

nametypeoptionaldescription
rendererPhaser.Renderer.WebGL.WebGLRendererNoThe WebGLRenderer to create the WebGLGlobalWrapper for.

Scope: static

Source: src/renderer/webgl/wrappers/WebGLGlobalWrapper.js#L10
Since: 4.0.0

Public Members

renderer

renderer: Phaser.Renderer.WebGL.WebGLRenderer

Description:

The WebGLRenderer this WebGLGlobalWrapper is associated with.

Source: src/renderer/webgl/wrappers/WebGLGlobalWrapper.js#L27
Since: 4.0.0


state

state: Phaser.Types.Renderer.WebGL.WebGLGlobalParameters

Description:

The current state of the WebGL global state.

Source: src/renderer/webgl/wrappers/WebGLGlobalWrapper.js#L36
Since: 4.0.0


Public Methods

update

<instance> update([state], [force], [vaoLast])

Description:

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:

nametypeoptionaldefaultdescription
statePhaser.Types.Renderer.WebGL.WebGLGlobalParametersYesThe state to set. If undefined, the current state is used when force is true.
forcebooleanYesfalseIf true, the state will be set regardless of the current state.
vaoLastbooleanYesfalseIf 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.

Source: src/renderer/webgl/wrappers/WebGLGlobalWrapper.js#L46
Since: 4.0.0


updateBindings

<instance> updateBindings(state, [force])

Description:

Updates the bindings state.

Parameters:

nametypeoptionaldefaultdescription
statePhaser.Types.Renderer.WebGL.WebGLGlobalParametersNoThe state to set.
forcebooleanYesfalseIf true, the state will be set regardless of the current state.

Source: src/renderer/webgl/wrappers/WebGLGlobalWrapper.js#L129
Since: 4.0.0


updateBindingsActiveTexture

<instance> updateBindingsActiveTexture(state, [force])

Description:

Updates the active texture unit state.

Parameters:

nametypeoptionaldefaultdescription
statePhaser.Types.Renderer.WebGL.WebGLGlobalParametersNoThe state to set.
forcebooleanYesfalseIf true, the state will be set regardless of the current state.

Source: src/renderer/webgl/wrappers/WebGLGlobalWrapper.js#L167
Since: 4.0.0


updateBindingsArrayBuffer

<instance> updateBindingsArrayBuffer(state, [force])

Description:

Updates the vertex array buffer state.

Parameters:

nametypeoptionaldefaultdescription
statePhaser.Types.Renderer.WebGL.WebGLGlobalParametersNoThe state to set.
forcebooleanYesfalseIf true, the state will be set regardless of the current state.

Source: src/renderer/webgl/wrappers/WebGLGlobalWrapper.js#L192
Since: 4.0.0


updateBindingsElementArrayBuffer

<instance> updateBindingsElementArrayBuffer(state, [force])

Description:

Updates the index array buffer state.

Parameters:

nametypeoptionaldefaultdescription
statePhaser.Types.Renderer.WebGL.WebGLGlobalParametersNoThe state to set.
forcebooleanYesfalseIf true, the state will be set regardless of the current state.

Source: src/renderer/webgl/wrappers/WebGLGlobalWrapper.js#L225
Since: 4.0.0


updateBindingsFramebuffer

<instance> updateBindingsFramebuffer(state, [force])

Description:

Updates the framebuffer state.

Parameters:

nametypeoptionaldefaultdescription
statePhaser.Types.Renderer.WebGL.WebGLGlobalParametersNoThe state to set.
forcebooleanYesfalseIf true, the state will be set regardless of the current state.

Source: src/renderer/webgl/wrappers/WebGLGlobalWrapper.js#L258
Since: 4.0.0


updateBindingsProgram

<instance> updateBindingsProgram(state, [force])

Description:

Updates the program state.

Parameters:

nametypeoptionaldefaultdescription
statePhaser.Types.Renderer.WebGL.WebGLGlobalParametersNoThe state to set.
forcebooleanYesfalseIf true, the state will be set regardless of the current state.

Source: src/renderer/webgl/wrappers/WebGLGlobalWrapper.js#L284
Since: 4.0.0


updateBindingsRenderbuffer

<instance> updateBindingsRenderbuffer(state, [force])

Description:

Updates the renderbuffer state.

Parameters:

nametypeoptionaldefaultdescription
statePhaser.Types.Renderer.WebGL.WebGLGlobalParametersNoThe state to set.
forcebooleanYesfalseIf true, the state will be set regardless of the current state.

Source: src/renderer/webgl/wrappers/WebGLGlobalWrapper.js#L309
Since: 4.0.0


updateBlend

<instance> updateBlend(state, [force])

Description:

Updates the blend state.

Parameters:

nametypeoptionaldefaultdescription
statePhaser.Types.Renderer.WebGL.WebGLGlobalParametersNoThe state to set.
forcebooleanYesfalseIf true, the state will be set regardless of the current state.

Source: src/renderer/webgl/wrappers/WebGLGlobalWrapper.js#L335
Since: 4.0.0


updateBlendColor

<instance> updateBlendColor(state, [force])

Description:

Updates the blend color.

Parameters:

nametypeoptionaldefaultdescription
statePhaser.Types.Renderer.WebGL.WebGLGlobalParametersNoThe state to set.
forcebooleanYesfalseIf true, the state will be set regardless of the current state.

Source: src/renderer/webgl/wrappers/WebGLGlobalWrapper.js#L364
Since: 4.0.0


updateBlendEnabled

<instance> updateBlendEnabled(state, [force])

Description:

Updates the blend enabled state.

Parameters:

nametypeoptionaldefaultdescription
statePhaser.Types.Renderer.WebGL.WebGLGlobalParametersNoThe state to set.
forcebooleanYesfalseIf true, the state will be set regardless of the current state.

Source: src/renderer/webgl/wrappers/WebGLGlobalWrapper.js#L395
Since: 4.0.0


updateBlendEquation

<instance> updateBlendEquation(state, [force])

Description:

Updates the blend equation state.

Equations are always treated as separate.

Parameters:

nametypeoptionaldefaultdescription
statePhaser.Types.Renderer.WebGL.WebGLGlobalParametersNoThe state to set.
forcebooleanYesfalseIf true, the state will be set regardless of the current state.

Source: src/renderer/webgl/wrappers/WebGLGlobalWrapper.js#L427
Since: 4.0.0


updateBlendFunc

<instance> updateBlendFunc(state, [force])

Description:

Updates the blend function state.

Functions are always treated as separate.

Parameters:

nametypeoptionaldefaultdescription
statePhaser.Types.Renderer.WebGL.WebGLGlobalParametersNoThe state to set.
forcebooleanYesfalseIf true, the state will be set regardless of the current state.

Source: src/renderer/webgl/wrappers/WebGLGlobalWrapper.js#L454
Since: 4.0.0


updateColorClearValue

<instance> updateColorClearValue(state, [force])

Description:

Updates the color clear value.

Parameters:

nametypeoptionaldefaultdescription
statePhaser.Types.Renderer.WebGL.WebGLGlobalParametersNoThe state to set.
forcebooleanYesfalseIf true, the state will be set regardless of the current state.

Source: src/renderer/webgl/wrappers/WebGLGlobalWrapper.js#L484
Since: 4.0.0


updateColorWritemask

<instance> updateColorWritemask(state, [force])

Description:

Updates the color writemask.

Parameters:

nametypeoptionaldefaultdescription
statePhaser.Types.Renderer.WebGL.WebGLGlobalParametersNoThe state to set.
forcebooleanYesfalseIf true, the state will be set regardless of the current state.

Source: src/renderer/webgl/wrappers/WebGLGlobalWrapper.js#L516
Since: 4.0.0


updateCullFace

<instance> updateCullFace(state, [force])

Description:

Updates the cull face state.

Parameters:

nametypeoptionaldefaultdescription
statePhaser.Types.Renderer.WebGL.WebGLGlobalParametersNoThe state to set.
forcebooleanYesfalseIf true, the state will be set regardless of the current state.

Source: src/renderer/webgl/wrappers/WebGLGlobalWrapper.js#L547
Since: 4.0.0


updateDepthTest

<instance> updateDepthTest(state, [force])

Description:

Updates the depth test state.

Parameters:

nametypeoptionaldefaultdescription
statePhaser.Types.Renderer.WebGL.WebGLGlobalParametersNoThe state to set.
forcebooleanYesfalseIf true, the state will be set regardless of the current state.

Source: src/renderer/webgl/wrappers/WebGLGlobalWrapper.js#L579
Since: 4.0.0


updateScissor

<instance> updateScissor(state, [force])

Description:

Updates the scissor state.

Parameters:

nametypeoptionaldefaultdescription
statePhaser.Types.Renderer.WebGL.WebGLGlobalParametersNoThe state to set.
forcebooleanYesfalseIf true, the state will be set regardless of the current state.

Source: src/renderer/webgl/wrappers/WebGLGlobalWrapper.js#L611
Since: 4.0.0


updateScissorBox

<instance> updateScissorBox(state, [force])

Description:

Updates the scissor box state.

Parameters:

nametypeoptionaldefaultdescription
statePhaser.Types.Renderer.WebGL.WebGLGlobalParametersNoThe state to set.
forcebooleanYesfalseIf true, the state will be set regardless of the current state.

Source: src/renderer/webgl/wrappers/WebGLGlobalWrapper.js#L664
Since: 4.0.0


updateScissorEnabled

<instance> updateScissorEnabled(state, [force])

Description:

Updates the scissor enabled state.

Parameters:

nametypeoptionaldefaultdescription
statePhaser.Types.Renderer.WebGL.WebGLGlobalParametersNoThe state to set.
forcebooleanYesfalseIf true, the state will be set regardless of the current state.

Source: src/renderer/webgl/wrappers/WebGLGlobalWrapper.js#L632
Since: 4.0.0


updateStencil

<instance> updateStencil(state, [force])

Description:

Updates the stencil state.

Parameters:

nametypeoptionaldefaultdescription
statePhaser.Types.Renderer.WebGL.WebGLGlobalParametersNoThe state to set.
forcebooleanYesfalseIf true, the state will be set regardless of the current state.

Source: src/renderer/webgl/wrappers/WebGLGlobalWrapper.js#L700
Since: 4.0.0


updateStencilClear

<instance> updateStencilClear(state, [force])

Description:

Updates the stencil clear state.

Parameters:

nametypeoptionaldefaultdescription
statePhaser.Types.Renderer.WebGL.WebGLGlobalParametersNoThe state to set.
forcebooleanYesfalseIf true, the state will be set regardless of the current state.

Source: src/renderer/webgl/wrappers/WebGLGlobalWrapper.js#L729
Since: 4.0.0


updateStencilEnabled

<instance> updateStencilEnabled(state, [force])

Description:

Updates the stencil enabled state.

Parameters:

nametypeoptionaldefaultdescription
statePhaser.Types.Renderer.WebGL.WebGLGlobalParametersNoThe state to set.
forcebooleanYesfalseIf true, the state will be set regardless of the current state.

Source: src/renderer/webgl/wrappers/WebGLGlobalWrapper.js#L753
Since: 4.0.0


updateStencilFunc

<instance> updateStencilFunc(state, [force])

Description:

Updates the stencil function state.

Parameters:

nametypeoptionaldefaultdescription
statePhaser.Types.Renderer.WebGL.WebGLGlobalParametersNoThe state to set.
forcebooleanYesfalseIf true, the state will be set regardless of the current state.

Source: src/renderer/webgl/wrappers/WebGLGlobalWrapper.js#L785
Since: 4.0.0


updateStencilOp

<instance> updateStencilOp(state, [force])

Description:

Updates the stencil operation state.

Parameters:

nametypeoptionaldefaultdescription
statePhaser.Types.Renderer.WebGL.WebGLGlobalParametersNoThe state to set.
forcebooleanYesfalseIf true, the state will be set regardless of the current state.

Source: src/renderer/webgl/wrappers/WebGLGlobalWrapper.js#L812
Since: 4.0.0


updateTexturing

<instance> updateTexturing(state, [force])

Description:

Updates the texturing state, which takes effect when creating a texture.

This includes flipY and premultiplyAlpha.

Parameters:

nametypeoptionaldefaultdescription
statePhaser.Types.Renderer.WebGL.WebGLGlobalParametersNoThe state to set.
forcebooleanYesfalseIf true, the state will be set regardless of the current state.

Source: src/renderer/webgl/wrappers/WebGLGlobalWrapper.js#L839
Since: 4.0.0


updateTexturingFlipY

<instance> updateTexturingFlipY(state, [force])

Description:

Updates the texture flipY state.

Parameters:

nametypeoptionaldefaultdescription
statePhaser.Types.Renderer.WebGL.WebGLGlobalParametersNoThe state to set.
forcebooleanYesfalseIf true, the state will be set regardless of the current state.

Source: src/renderer/webgl/wrappers/WebGLGlobalWrapper.js#L861
Since: 4.0.0


updateTexturingPremultiplyAlpha

<instance> updateTexturingPremultiplyAlpha(state, [force])

Description:

Updates the texture premultiplyAlpha state.

Parameters:

nametypeoptionaldefaultdescription
statePhaser.Types.Renderer.WebGL.WebGLGlobalParametersNoThe state to set.
forcebooleanYesfalseIf true, the state will be set regardless of the current state.

Source: src/renderer/webgl/wrappers/WebGLGlobalWrapper.js#L886
Since: 4.0.0


updateVAO

<instance> updateVAO(state, [force])

Description:

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:

nametypeoptionaldefaultdescription
statePhaser.Types.Renderer.WebGL.WebGLGlobalParametersNoThe state to set.
forcebooleanYesfalseIf true, the state will be set regardless of the current state.

Source: src/renderer/webgl/wrappers/WebGLGlobalWrapper.js#L911
Since: 4.0.0


updateViewport

<instance> updateViewport(state, [force])

Description:

Updates the viewport state.

Parameters:

nametypeoptionaldefaultdescription
statePhaser.Types.Renderer.WebGL.WebGLGlobalParametersNoThe state to set.
forcebooleanYesfalseIf true, the state will be set regardless of the current state.

Source: src/renderer/webgl/wrappers/WebGLGlobalWrapper.js#L950
Since: 4.0.0