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.
new WebGLFramebufferWrapper(gl, width, height, renderTexture, [addDepthStencilBuffer])
name | type | arguments | Default | description |
---|---|---|---|---|
gl | WebGLRenderingContext |
The WebGLRenderingContext to create the WebGLFramebuffer for. |
||
width | number |
If |
||
height | number |
If |
||
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? |
Create a Renderbuffer for the depth stencil?
The WebGL context this WebGLFramebuffer belongs to.
Height of the depth stencil.
The color texture where the color pixels are written.
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.
Width of the depth stencil.
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.
Destroys this WebGLFramebufferWrapper.