gameforge - v0.1.12
    Preparing search index...

    Class GeometrySystem

    System plugin to the renderer to manage geometry.

    PIXI

    Implements

    Index

    Constructors

    Properties

    _activeGeometry: Geometry
    _activeVao: WebGLVertexArrayObject
    _boundBuffer: GLBuffer
    canUseUInt32ElementIndex: boolean

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

    CONTEXT_UID: number
    hasInstance: boolean

    true if has ANGLE_instanced_arrays extension.

    hasVao: boolean

    true if we has *_vertex_array_object extension.

    managedGeometries: { [key: number]: Geometry }

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

    Methods

    • Activate vertex array object.

      Parameters

      • geometry: Geometry

        Geometry instance.

      • program: Program

        Shader program instance.

      Returns void

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

      Parameters

      • Optionalgeometry: Geometry

        Instance of geometry to bind.

      • Optionalshader: Shader

        Instance of shader to use vao for.

      Returns void

    • Check compatibility between a geometry and a program

      Parameters

      Returns void

    • Sets up the renderer context and necessary buffers.

      Returns void

    • Generic destroy methods to be overridden by the subclass

      Returns void

    • Dispose all WebGL resources of all managed geometries.

      Parameters

      • OptionalcontextLost: boolean

        If context was lost, we suppress gl.delete calls

      Returns void

    • Disposes geometry.

      Parameters

      • geometry: Geometry

        Geometry with buffers. Only VAO will be disposed

      • OptionalcontextLost: boolean

        If context was lost, we suppress deleteVertexArray

      Returns void

    • Draws the currently bound geometry.

      Parameters

      • type: DRAW_MODES

        The type primitive to render.

      • Optionalsize: number

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

      • Optionalstart: number

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

      • OptionalinstanceCount: number

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

      Returns this

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

      Parameters

      • geometry: Geometry

        To get signature from.

      • program: Program

        To test geometry against.

      Returns string

      • Unique signature of the geometry and program
    • 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

      • geometry: Geometry

        Instance of geometry to to generate Vao for.

      • shader: Shader

        Instance of the shader.

      • OptionalincRefCount: boolean

        Increment refCount of all geometry buffers.

      Returns WebGLVertexArrayObject

    • Reset and unbind any active VAO and geometry.

      Returns void

    • Unbind/reset everything.

      Returns void

    • Update buffers of the currently bound geometry.

      Returns void