PIXI.GeometrySystem
class GeometrySystem implements PIXI.ISystem
System plugin to the renderer to manage geometry.
Constructor
new PIXI.GeometrySystem(renderer: PIXI.Renderer) → {}
| Name | Type | Description |
|---|---|---|
| renderer | PIXI.Renderer |
The renderer this System works for. |
Summary
Properties from GeometrySystem
| boolean |
|
| boolean |
|
| boolean |
|
| { [key: number]: PIXI.Geometry } |
Cache for all geometries by id, used in case renderer gets destroyed or for profiling. |
Methods from GeometrySystem
| void |
|
| void |
|
| void |
|
| this |
|
| void |
Reset and unbind any active VAO and geometry. |
| void |
Update buffers of the currently bound geometry. |
| void |
|
| void |
|
| void |
Sets up the renderer context and necessary buffers. |
| string |
|
| WebGLVertexArrayObject |
|
| void |
Unbind/reset everything. |
Public Properties
canUseUInt32ElementIndex: boolean
true if support gl.UNSIGNED_INT in gl.drawElements or gl.drawElementsInstanced.
managedGeometries: { [key: number]: PIXI.Geometry }
Cache for all geometries by id, used in case renderer gets destroyed or for profiling.
Public Methods
bind(geometry: PIXI.Geometry, shader: PIXI.Shader) → {void}
Binds geometry so that is can be drawn. Creating a Vao if required
| Name | Type | Attributes | Description |
|---|---|---|---|
| geometry | PIXI.Geometry |
<optional> |
Instance of geometry to bind. |
| shader | PIXI.Shader |
<optional> |
Instance of shader to use vao for. |
| Type | Description |
|---|---|
| void |
disposeAll(contextLost: boolean) → {void}
Dispose all WebGL resources of all managed geometries.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
| contextLost | boolean |
<optional> |
false |
If context was lost, we suppress |
| Type | Description |
|---|---|
| void |
disposeGeometry(geometry: PIXI.Geometry, contextLost: boolean) → {void}
Disposes geometry.
| 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 |
| Type | Description |
|---|---|
| void |
draw(type: PIXI.DRAW_MODES, size: number, start: number, instanceCount: number) → {this}
Draws the currently bound geometry.
| 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. |
| Type | Description |
|---|---|
| this |
reset() → {void}
Reset and unbind any active VAO and geometry.
| Type | Description |
|---|---|
| void |
updateBuffers() → {void}
Update buffers of the currently bound geometry.
| Type | Description |
|---|---|
| void |
Protected Methods
protected activateVao(geometry: PIXI.Geometry, program: PIXI.Program) → {void}
Activate vertex array object.
| Name | Type | Description |
|---|---|---|
| geometry | PIXI.Geometry |
Geometry instance. |
| program | PIXI.Program |
Shader program instance. |
| Type | Description |
|---|---|
| void |
protected checkCompatibility(geometry: PIXI.Geometry, program: PIXI.Program) → {void}
Check compatibility between a geometry and a program
| Name | Type | Description |
|---|---|---|
| geometry | PIXI.Geometry |
Geometry instance. |
| program | PIXI.Program |
Program instance. |
| Type | Description |
|---|---|
| void |
protected contextChange() → {void}
Sets up the renderer context and necessary buffers.
| Type | Description |
|---|---|
| void |
protected getSignature(geometry: PIXI.Geometry, program: PIXI.Program) → {string}
Takes a geometry and program and generates a unique signature for them.
| Name | Type | Description |
|---|---|---|
| geometry | PIXI.Geometry |
To get signature from. |
| program | PIXI.Program |
To test geometry against. |
| Type | Description |
|---|---|
| string |
|
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.
| 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. |
| Type | Description |
|---|---|
| WebGLVertexArrayObject |
protected unbind() → {void}
Unbind/reset everything.
| Type | Description |
|---|---|
| void |