Class: ContextSystem

System plugin to the renderer to manage the context.

new (renderer)

Name Type Description
renderer PIXI.Renderer

The renderer this System works for.



extensions object readonly

Extensions being used

Name Type Description
drawBuffers WEBGL_draw_buffers

WebGL v1 extension

depthTexture WEBGL_depth_texture

WebGL v1 extension

floatTexture OES_texture_float

WebGL v1 extension

loseContext WEBGL_lose_context

WebGL v1 extension

vertexArrayObject OES_vertex_array_object

WebGL v1 extension

anisotropicFiltering EXT_texture_filter_anisotropic

WebGL v1 and v2 extension

isLost boolean readonly

true if the context is lost

The renderer this manager works for.

webGLVersion number readonly

Either 1 or 2 to reflect the WebGL version being used


contextChange (gl)

Handle the context change event

Name Type Description
gl WebGLRenderingContext

new webgl context

createContext (canvas, options)WebGLRenderingContext

Helper class to create a WebGL Context

Name Type Description
canvas HTMLCanvasElement

the canvas element that we will get the context from

options object

An options object that gets passed in to the canvas element containing the context attributes

Type Description
WebGLRenderingContext the WebGL context

Generic destroy methods to be overridden by the subclass

getExtensions () protected

Auto-populate the extensions

handleContextLost (event) protected

Handles a lost webgl context

Name Type Description
event WebGLContextEvent

The context lost event.

handleContextRestored () protected

Handles a restored webgl context

initFromContext (gl) protected

Initialize the context

Name Type Description
gl WebGLRenderingContext

WebGL context

initFromOptions (options) protected

Initialize from context options

Name Type Description
options object

context attributes


postrender () protected

Handle the post-render runner event

validateContext (gl) protected

Validate context

Name Type Description
gl WebGLRenderingContext

Render context