PIXI.GeometrySystem

class GeometrySystem implements PIXI.ISystem

System plugin to the renderer to manage geometry.

Constructor


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

The renderer this System works for.

Summary


Properties from GeometrySystem

boolean
canUseUInt32ElementIndex
boolean
hasInstance
boolean
hasVao
{ [key: number]: PIXI.Geometry }
managedGeometries

Cache for all geometries by id, used in case renderer gets destroyed or for profiling.

Methods from GeometrySystem

void
bind(geometry: PIXI.Geometry, shader: PIXI.Shader)
void
disposeAll(contextLost: boolean)
void
disposeGeometry(geometry: PIXI.Geometry, contextLost: boolean)
this
draw(type: PIXI.DRAW_MODES, size: number, start: number, instanceCount: number)
void
reset()

Reset and unbind any active VAO and geometry.

void
updateBuffers()

Update buffers of the currently bound geometry.

void
protected activateVao(geometry: PIXI.Geometry, program: PIXI.Program)
void
protected checkCompatibility(geometry: PIXI.Geometry, program: PIXI.Program)
void
protected contextChange()

Sets up the renderer context and necessary buffers.

string
protected getSignature(geometry: PIXI.Geometry, program: PIXI.Program)
WebGLVertexArrayObject
protected initGeometryVao(geometry: PIXI.Geometry, shader: PIXI.Shader, incRefCount: boolean)
void
protected unbind()

Unbind/reset everything.

Public Properties


canUseUInt32ElementIndex GeometrySystem.ts:34
canUseUInt32ElementIndex: boolean

true if support gl.UNSIGNED_INT in gl.drawElements or gl.drawElementsInstanced.

hasInstance GeometrySystem.ts:28
hasInstance: boolean

true if has ANGLE_instanced_arrays extension.

hasVao GeometrySystem.ts:22
hasVao: boolean

true if we has *_vertex_array_object extension.

managedGeometries GeometrySystem.ts:46
managedGeometries: { [key: number]: PIXI.Geometry }

Cache for all geometries by id, used in case renderer gets destroyed or for profiling.

Public Methods


bind GeometrySystem.ts:135
bind(geometry: PIXI.Geometry, shader: PIXI.Shader) → {void}

Binds geometry so that is can be drawn. Creating a Vao if required

Parameters:
Name Type Attributes Description
geometry PIXI.Geometry

<optional>

Instance of geometry to bind.

shader PIXI.Shader

<optional>

Instance of shader to use vao for.

Returns:
Type Description
void
disposeAll GeometrySystem.ts:436
disposeAll(contextLost: boolean) → {void}

Dispose all WebGL resources of all managed geometries.

Parameters:
Name Type Attributes Default Description
contextLost boolean

<optional>

false

If context was lost, we suppress gl.delete calls

Returns:
Type Description
void
disposeGeometry GeometrySystem.ts:368
disposeGeometry(geometry: PIXI.Geometry, contextLost: boolean) → {void}

Disposes geometry.

Parameters:
Name Type Attributes Default Description
geometry PIXI.Geometry

Geometry with buffers. Only VAO will be disposed

contextLost boolean

<optional>

false

If context was lost, we suppress deleteVertexArray

Returns:
Type Description
void
draw GeometrySystem.ts:516
draw(type: PIXI.DRAW_MODES, size: number, start: number, instanceCount: number) → {this}

Draws the currently bound geometry.

Parameters:
Name Type Attributes Description
type PIXI.DRAW_MODES

The type primitive to render.

size number

<optional>

The number of elements to be rendered. If not specified, all vertices after the starting vertex will be drawn.

start number

<optional>

The starting vertex in the geometry to start drawing from. If not specified, drawing will start from the first vertex.

instanceCount number

<optional>

The number of instances of the set of elements to execute. If not specified, all instances will be drawn.

Returns:
Type Description
this
reset GeometrySystem.ts:185
reset() → {void}

Reset and unbind any active VAO and geometry.

Returns:
Type Description
void
updateBuffers GeometrySystem.ts:191
updateBuffers() → {void}

Update buffers of the currently bound geometry.

Returns:
Type Description
void

Protected Methods


activateVao GeometrySystem.ts:450
protected activateVao(geometry: PIXI.Geometry, program: PIXI.Program) → {void}

Activate vertex array object.

Parameters:
Name Type Description
geometry PIXI.Geometry

Geometry instance.

program PIXI.Program

Shader program instance.

Returns:
Type Description
void
checkCompatibility GeometrySystem.ts:206
protected checkCompatibility(geometry: PIXI.Geometry, program: PIXI.Program) → {void}

Check compatibility between a geometry and a program

Parameters:
Name Type Description
geometry PIXI.Geometry

Geometry instance.

program PIXI.Program

Program instance.

Returns:
Type Description
void
contextChange GeometrySystem.ts:65
protected contextChange() → {void}

Sets up the renderer context and necessary buffers.

Returns:
Type Description
void
getSignature GeometrySystem.ts:226
protected getSignature(geometry: PIXI.Geometry, program: PIXI.Program) → {string}

Takes a geometry and program and generates a unique signature for them.

Parameters:
Name Type Description
geometry PIXI.Geometry

To get signature from.

program PIXI.Program

To test geometry against.

Returns:
Type Description
string
  • Unique signature of the geometry and program
initGeometryVao GeometrySystem.ts:250
protected initGeometryVao(geometry: PIXI.Geometry, shader: PIXI.Shader, incRefCount: boolean) → {WebGLVertexArrayObject}

Creates or gets Vao with the same structure as the geometry and stores it on the geometry. If vao is created, it is bound automatically. We use a shader to infer what and how to set up the attribute locations.

Parameters:
Name Type Default Description
geometry PIXI.Geometry

Instance of geometry to to generate Vao for.

shader PIXI.Shader

Instance of the shader.

incRefCount boolean true

Increment refCount of all geometry buffers.

Returns:
Type Description
WebGLVertexArrayObject
unbind GeometrySystem.ts:571
protected unbind() → {void}

Unbind/reset everything.

Returns:
Type Description
void

Powered by webdoc!