PIXI.ContextSystem

class ContextSystem implements PIXI.ISystem

System plugin to the renderer to manage the context.

Constructor


new PIXI.ContextSystem(renderer: PIXI.Renderer) → {}
Parameters:
Name Type Description
renderer PIXI.Renderer

The renderer this System works for.

Public Properties


extensions ContextSystem.ts:39
extensions: object

Extensions available.

Properties:
Name Type Description
anisotropicFiltering EXT_texture_filter_anisotropic

WebGL v1 and v2 extension

depthTexture WEBGL_depth_texture

WebGL v1 extension

drawBuffers WEBGL_draw_buffers

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

isLost ContextSystem.ts:74
isLost: boolean

true if the context is lost

supports ContextSystem.ts:28
supports: object

Features supported by current context.

Properties:
Name Type Description
uint32Indices boolean

Support for 32-bit indices buffer.

webGLVersion ContextSystem.ts:22
webGLVersion: number

Either 1 or 2 to reflect the WebGL version being used.

Public Methods


createContext ContextSystem.ts:127
createContext(canvas: HTMLCanvasElement, options: WebGLContextAttributes) → {WebGLRenderingContext}

Helper class to create a WebGL Context

Parameters:
Name Type Description
canvas HTMLCanvasElement

the canvas element that we will get the context from

options WebGLContextAttributes

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

Returns:
Type Description
WebGLRenderingContext

the WebGL context

See: https://developer.mozilla.org/en/docs/Web/API/HTMLCanvasElement/getContext

Protected Methods


contextChange ContextSystem.ts:83
protected contextChange(gl: WebGLRenderingContext) → {void}

Handles the context change event.

Parameters:
Name Type Description
gl WebGLRenderingContext

New WebGL context.

Returns:
Type Description
void
getExtensions ContextSystem.ts:168
protected getExtensions() → {void}

Auto-populate the extensions.

Returns:
Type Description
void
handleContextLost ContextSystem.ts:214
protected handleContextLost(event: WebGLContextEvent) → {void}

Handles a lost webgl context

Parameters:
Name Type Description
event WebGLContextEvent

The context lost event.

Returns:
Type Description
void
handleContextRestored ContextSystem.ts:223
protected handleContextRestored() → {void}

Handles a restored webgl context.

Returns:
Type Description
void
initFromContext ContextSystem.ts:100
protected initFromContext(gl: WebGLRenderingContext) → {void}

Initializes the context.

Parameters:
Name Type Description
gl WebGLRenderingContext

WebGL context

Returns:
Type Description
void
initFromOptions ContextSystem.ts:114
protected initFromOptions(options: object) → {void}

Initialize from context options

Parameters:
Name Type Description
options object

context attributes

Returns:
Type Description
void
See: https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/getContext
postrender ContextSystem.ts:247
protected postrender() → {void}

Handle the post-render runner event.

Returns:
Type Description
void
validateContext ContextSystem.ts:256
protected validateContext(gl: WebGLRenderingContext) → {void}

Validate context.

Parameters:
Name Type Description
gl WebGLRenderingContext

Render context.

Returns:
Type Description
void

Powered by webdoc!