PIXI.FramebufferSystem
class FramebufferSystem implements PIXI.ISystem
System plugin to the renderer to manage framebuffers.
Constructor
new PIXI.FramebufferSystem(renderer: PIXI.Renderer) → {}
Name | Type | Description |
---|---|---|
renderer | PIXI.Renderer |
The renderer this System works for. |
Summary
Properties from FramebufferSystem
Array<PIXI.Framebuffer> |
A list of managed framebuffers. |
{ x : number, y : number, width : number, height : number } |
|
PIXI.Framebuffer |
Framebuffer value that shows that we don't know what is bound. |
Methods from FramebufferSystem
Public Properties
managedFramebuffers: Array<PIXI.Framebuffer>
A list of managed framebuffers.
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
protected unknownFramebuffer: PIXI.Framebuffer
Framebuffer value that shows that we don't know what is bound.
Public Methods
bind(framebuffer: PIXI.Framebuffer, frame: PIXI.Rectangle, mipLevel: number) → {void}
Bind a framebuffer.
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 |
Type | Description |
---|---|
void |
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
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 |
Type | Description |
---|---|
void |
clear(r: number, g: number, b: number, a: number, mask: PIXI.BUFFER_BITS) → {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. |
Type | Description |
---|---|
void |
disposeAll(contextLost: boolean) → {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 |
Type | Description |
---|---|
void |
disposeFramebuffer(framebuffer: PIXI.Framebuffer, contextLost: boolean) → {void}
Disposes framebuffer.
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 |
Type | Description |
---|---|
void |
reset() → {void}
Resets framebuffer stored state, binds screen framebuffer. Should be called before renderTexture reset().
Type | Description |
---|---|
void |
setViewport(x: number, y: number, width: number, height: number) → {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 |
Type | Description |
---|---|
void |
Protected Methods
protected canMultisampleFramebuffer(framebuffer: PIXI.Framebuffer) → {boolean}
Returns true if the frame buffer can be multisampled.
Name | Type | Description |
---|---|---|
framebuffer | PIXI.Framebuffer |
Type | Description |
---|---|
boolean |
protected contextChange() → {void}
Sets up the renderer context and necessary buffers.
Type | Description |
---|---|
void |
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
Name | Type | Description |
---|---|---|
samples | PIXI.MSAA_QUALITY |
number of samples |
Type | Description |
---|---|
PIXI.MSAA_QUALITY |
|
protected initFramebuffer(framebuffer: PIXI.Framebuffer) → {PIXI.GLFramebuffer}
Initialize framebuffer for this context
Name | Type | Description |
---|---|---|
framebuffer | PIXI.Framebuffer |
Type | Description |
---|---|
PIXI.GLFramebuffer |
|
protected resizeFramebuffer(framebuffer: PIXI.Framebuffer) → {void}
Resize the framebuffer
Name | Type | Description |
---|---|---|
framebuffer | PIXI.Framebuffer |
Type | Description |
---|---|
void |
protected updateFramebuffer(framebuffer: PIXI.Framebuffer, mipLevel: number) → {void}
Update the framebuffer
Name | Type | Description |
---|---|---|
framebuffer | PIXI.Framebuffer | |
mipLevel | number |
Type | Description |
---|---|
void |