Class: FramebufferSystem

PIXI.FramebufferSystem

System plugin to the renderer to manage framebuffers.

new PIXI.FramebufferSystem (renderer) overrides

Name Type Description
renderer PIXI.Renderer

The renderer this System works for.

Extends

Members

managedFramebuffers Array<PIXI.Framebuffer>

A list of managed framebuffers

size object

Get the size of the current width and height. Returns object with width and height values.

unknownFramebuffer Framebuffer

Framebuffer value that shows that we don't know what is bound

Methods

bind (framebuffer, frame) void

Bind a framebuffer

Name Type Attributes Description
framebuffer PIXI.Framebuffer <optional>
frame PIXI.Rectangle <optional>

frame, default is framebuffer size

blit (framebuffer, sourcePixels, destPixels) void

Only works with WebGL2

blits framebuffer to another of the same or bigger size after that target framebuffer is bound

Fails with WebGL warning if blits multisample framebuffer to different size

Name Type Attributes Description
framebuffer PIXI.Framebuffer <optional>

by default it blits "into itself", from renderBuffer to texture.

sourcePixels PIXI.Rectangle <optional>

source rectangle in pixels

destPixels PIXI.Rectangle <optional>

dest rectangle in pixels, assumed to be the same as sourcePixels

clear (r, g, b, a, mask) void

Clear the color of the context

Name Type Attributes Default Description
r Number

Red value from 0 to 1

g Number

Green value from 0 to 1

b Number

Blue value from 0 to 1

a Number

Alpha value from 0 to 1

mask PIXI.BUFFER_BITS <optional>
BUFFER_BITS.COLOR | BUFFER_BITS.DEPTH

Bitwise OR of masks that indicate the buffers to be cleared, by default COLOR and DEPTH buffers.

contextChange () void

Sets up the renderer context and necessary buffers.

Detects number of samples that is not more than a param but as close to it as possible

Name Type Description
samples PIXI.MSAA_QUALITY

number of samples

Returns:
Type Description
PIXI.MSAA_QUALITY
  • recommended number of samples

disposeAll (contextLost) void

Disposes all framebuffers, but not textures bound to them

Name Type Attributes Default Description
contextLost boolean <optional>
false

If context was lost, we suppress all delete function calls

disposeFramebuffer (framebuffer, contextLost) void

Disposes framebuffer

Name Type Attributes Default Description
framebuffer PIXI.Framebuffer

framebuffer that has to be disposed of

contextLost boolean <optional>
false

If context was lost, we suppress all delete function calls

reset () void

resets framebuffer stored state, binds screen framebuffer

should be called before renderTexture reset()

setViewport (x, y, width, height) void

Set the WebGLRenderingContext's viewport.

Name Type Description
x Number

X position of viewport

y Number

Y position of viewport

width Number

Width of viewport

height Number

Height of viewport

initFramebuffer (framebuffer) PIXI.GLFramebuffer protected

Initialize framebuffer for this context

Name Type Description
framebuffer PIXI.Framebuffer
Returns:
Type Description
PIXI.GLFramebuffer created GLFramebuffer

resizeFramebuffer (framebuffer) void protected

Resize the framebuffer

Name Type Description
framebuffer PIXI.Framebuffer

updateFramebuffer (framebuffer) void protected

Update the framebuffer

Name Type Description
framebuffer PIXI.Framebuffer

Inherited Properties

From class PIXI.System

The renderer this manager works for.

Inherited Methods

From class PIXI.System

destroy () void inherited

Generic destroy methods to be overridden by the subclass