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 glWebGLRenderingContext The current WebGL rendering context
widthNumber the width of the drawing area of the frame buffer
heightNumber the height of the drawing area of the frame buffer
dataArrayBuffer | 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 glWebGLRenderingContext The current WebGL rendering context
widthNumber the width of the drawing area of the frame buffer
heightNumber the height of the drawing area of the frame buffer
dataArrayBuffer | SharedArrayBuffer | ArrayBufferView an array of data
-
bind()
-
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 rNumber the red value of the clearing colour
gNumber the green value of the clearing colour
bNumber the blue value of the clearing colour
aNumber the alpha value of the clearing colour
-
destroy()
-
Destroys this buffer
-
enableStencil()
-
Initialises the stencil buffer
-
enableTexture(texture)
-
Adds a texture to the frame buffer
Name Type Description texturePIXI.glCore.GLTexture -
resize(width, height)
-
Resizes the drawing area of the buffer to the given width and height
Name Type Description widthNumber the new width
heightNumber the new height
-
unbind()
-
Unbinds the frame buffer to the WebGL context