PIXI.FramebufferSystem

class FramebufferSystem implements PIXI.ISystem

System plugin to the renderer to manage framebuffers.

Constructor


new PIXI.FramebufferSystem(renderer: PIXI.Renderer) → {}
Parameters:
Name Type Description
renderer PIXI.Renderer

The renderer this System works for.

Summary


Properties from FramebufferSystem

Array<PIXI.Framebuffer>
managedFramebuffers

A list of managed framebuffers.

{ x : number, y : number, width : number, height : number }
size
PIXI.Framebuffer
protected unknownFramebuffer

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

Public Properties


managedFramebuffers FramebufferSystem.ts:19
managedFramebuffers: Array<PIXI.Framebuffer>

A list of managed framebuffers.

size FramebufferSystem.ts:226
size: { x : number, y : number, width : number, height : number }

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

Protected Properties


unknownFramebuffer FramebufferSystem.ts:28
protected unknownFramebuffer: PIXI.Framebuffer

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

Public Methods


bind FramebufferSystem.ts:98
bind(framebuffer: PIXI.Framebuffer, frame: PIXI.Rectangle, mipLevel: number) → {void}

Bind a framebuffer.

Parameters:
Name Type Attributes Default Description
framebuffer PIXI.Framebuffer

<optional>

frame PIXI.Rectangle

<optional>

frame, default is framebuffer size

mipLevel number 0

optional mip level to set on the framebuffer - defaults to 0

Returns:
Type Description
void
blit FramebufferSystem.ts:489
blit(framebuffer: PIXI.Framebuffer, sourcePixels: PIXI.Rectangle, destPixels: PIXI.Rectangle) → {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

Parameters:
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

Returns:
Type Description
void
clear FramebufferSystem.ts:241
clear(r: number, g: number, b: number, a: number, mask: PIXI.BUFFER_BITS) → {void}

Clear the color of the context

Parameters:
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.

Returns:
Type Description
void
disposeAll FramebufferSystem.ts:626
disposeAll(contextLost: boolean) → {void}

Disposes all framebuffers, but not textures bound to them.

Parameters:
Name Type Attributes Default Description
contextLost boolean

<optional>

false

If context was lost, we suppress all delete function calls

Returns:
Type Description
void
disposeFramebuffer FramebufferSystem.ts:579
disposeFramebuffer(framebuffer: PIXI.Framebuffer, contextLost: boolean) → {void}

Disposes framebuffer.

Parameters:
Name Type Attributes Description
framebuffer PIXI.Framebuffer

framebuffer that has to be disposed of

contextLost boolean

<optional>

If context was lost, we suppress all delete function calls

Returns:
Type Description
void
reset FramebufferSystem.ts:687
reset() → {void}

Resets framebuffer stored state, binds screen framebuffer. Should be called before renderTexture reset().

Returns:
Type Description
void
setViewport FramebufferSystem.ts:199
setViewport(x: number, y: number, width: number, height: number) → {void}

Set the WebGLRenderingContext's viewport.

Parameters:
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

Returns:
Type Description
void

Protected Methods


canMultisampleFramebuffer FramebufferSystem.ts:448
protected canMultisampleFramebuffer(framebuffer: PIXI.Framebuffer) → {boolean}

Returns true if the frame buffer can be multisampled.

Parameters:
Name Type Description
framebuffer PIXI.Framebuffer
Returns:
Type Description
boolean
contextChange FramebufferSystem.ts:45
protected contextChange() → {void}

Sets up the renderer context and necessary buffers.

Returns:
Type Description
void
detectSamples FramebufferSystem.ts:458
protected detectSamples(samples: PIXI.MSAA_QUALITY) → {PIXI.MSAA_QUALITY}

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

Parameters:
Name Type Description
samples PIXI.MSAA_QUALITY

number of samples

Returns:
Type Description
PIXI.MSAA_QUALITY
  • recommended number of samples
initFramebuffer FramebufferSystem.ts:259
protected initFramebuffer(framebuffer: PIXI.Framebuffer) → {PIXI.GLFramebuffer}

Initialize framebuffer for this context

Parameters:
Name Type Description
framebuffer PIXI.Framebuffer
Returns:
Type Description
PIXI.GLFramebuffer
  • created GLFramebuffer
resizeFramebuffer FramebufferSystem.ts:279
protected resizeFramebuffer(framebuffer: PIXI.Framebuffer) → {void}

Resize the framebuffer

Parameters:
Name Type Description
framebuffer PIXI.Framebuffer
Returns:
Type Description
void
updateFramebuffer FramebufferSystem.ts:335
protected updateFramebuffer(framebuffer: PIXI.Framebuffer, mipLevel: number) → {void}

Update the framebuffer

Parameters:
Name Type Description
framebuffer PIXI.Framebuffer
mipLevel number
Returns:
Type Description
void

Powered by webdoc!