Phaser API Documentation

  Version: 
Filter

Wrapper for a WebGL frame buffer, containing all the information that was used to create it.

A WebGLFramebuffer should never be exposed outside the WebGLRenderer, so the WebGLRenderer can handle context loss and other events without other systems having to be aware of it. Always use WebGLFramebufferWrapper instead.

Constructor:

new WebGLFramebufferWrapper(gl, width, height, renderTexture, [addDepthStencilBuffer])

Parameters:

name type arguments Default description
gl WebGLRenderingContext

The WebGLRenderingContext to create the WebGLFramebuffer for.

width number

If addDepthStencilBuffer is true, this controls the width of the depth stencil.

height number

If addDepthStencilBuffer is true, this controls the height of the depth stencil.

renderTexture Phaser.Renderer.WebGL.Wrappers.WebGLTextureWrapper

The color texture where the color pixels are written.

addDepthStencilBuffer boolean <optional> false

Create a Renderbuffer for the depth stencil?

Members

addDepthStencilBuffer: boolean
Focus
Focus

Description:

Create a Renderbuffer for the depth stencil?

Type:
boolean
Default: false
Focus
Focus
gl: WebGLRenderingContext
Focus
Focus

Description:

The WebGL context this WebGLFramebuffer belongs to.

Type:
WebGLRenderingContext
Focus
Focus
height: number
Focus
Focus

Description:

Height of the depth stencil.

Type:
number
Focus
Focus

Description:

The color texture where the color pixels are written.

Type:
Focus
Focus
<nullable> webGLFramebuffer: WebGLFramebuffer
Focus
Focus

Description:

The WebGLFramebuffer being wrapped by this class.

This property could change at any time. Therefore, you should never store a reference to this value. It should only be passed directly to the WebGL API for drawing.

Type:
WebGLFramebuffer
Default: null
Focus
Focus
width: number
Focus
Focus

Description:

Width of the depth stencil.

Type:
number
Focus
Focus

Methods

createResource()
Focus
Focus

Description:

Creates a WebGLFramebuffer from the given parameters.

This is called automatically by the constructor. It may also be called again if the WebGLFramebuffer needs re-creating.

Focus
Focus
destroy()
Focus
Focus

Description:

Destroys this WebGLFramebufferWrapper.

Focus
Focus