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

framebufferWebGLFramebuffer

The frame buffer

glWebGLRenderingContext

The current WebGL rendering context

heightNumber

The height of the drawing area of the buffer

stencilWebGLRenderbuffer

The stencil buffer

texturePIXI.glCore.GLTexture

The stencil buffer

widthNumber

The width of the drawing area of the buffer

Methods

staticPIXI.glCore.Framebuffer.createFloat32(gl, width, height, data)

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

staticPIXI.glCore.Framebuffer.createRGBA(gl, width, height, data)

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