Class: Framebuffer

Framebuffer

new PIXI.glCore.Framebuffer (gl, width, height)

Helper class to create a webGL Framebuffer

Name Type Description
gl WebGLRenderingContext

The current WebGL rendering context

width Number

the width of the drawing area of the frame buffer

height Number

the height of the drawing area of the frame buffer

Members

framebuffer WebGLFramebuffer

The frame buffer

gl WebGLRenderingContext

The current WebGL rendering context

height Number

The height of the drawing area of the buffer

stencil WebGLRenderbuffer

The stencil buffer

texture PIXI.glCore.GLTexture

The stencil buffer

width Number

The width of the drawing area of the buffer

Methods

PIXI.glCore.Framebuffer.createFloat32 (gl, width, height, data) static

Creates a frame buffer with a texture containing the given data

Name Type Description
gl WebGLRenderingContext

The current WebGL rendering context

width Number

the width of the drawing area of the frame buffer

height Number

the height of the drawing area of the frame buffer

data ArrayBuffer | SharedArrayBuffer | ArrayBufferView

an array of data

PIXI.glCore.Framebuffer.createRGBA (gl, width, height, data) static

Creates a frame buffer with a texture containing the given data

Name Type Description
gl WebGLRenderingContext

The current WebGL rendering context

width Number

the width of the drawing area of the frame buffer

height Number

the height of the drawing area of the frame buffer

data ArrayBuffer | SharedArrayBuffer | ArrayBufferView

an array of data

Binds the frame buffer to the WebGL context

clear (r, g, b, a)

Erases the drawing area and fills it with a colour

Name Type Description
r Number

the red value of the clearing colour

g Number

the green value of the clearing colour

b Number

the blue value of the clearing colour

a Number

the alpha value of the clearing colour

Destroys this buffer

enableStencil ()

Initialises the stencil buffer

enableTexture (texture)

Adds a texture to the frame buffer

Name Type Description
texture PIXI.glCore.GLTexture

resize (width, height)

Resizes the drawing area of the buffer to the given width and height

Name Type Description
width Number

the new width

height Number

the new height

Unbinds the frame buffer to the WebGL context