Class Vao

A collection of attribute state; a vertex attribute array.

Hierarchy

  • Vao

Constructors

  • Creates a vertex array object.

    Parameters

    • program: Program

      The program that the VAO is used with.

    • attributes: BufferInfo[] = []

      The attributes associated with the VAO.

    • Optional indices: UintTypedArray

      The indices to supply to the element array buffer of this VAO if the data should be indexed.

    Returns Vao

Properties

attributesPrivate: BufferInfo[]

The attributes associated with this VAO.

context: Context

The rendering context of this VAO.

elementArrayBuffer: undefined | Buffer

The element array buffer of this VAO if its data is indexed.

internal: WebGLVertexArrayObject

The WebGL API interface of this VAO.

program: Program

The program that this VAO is used with.

Accessors

Methods

  • Adds an attribute to this VAO.

    Parameters

    Returns void

  • Rasterizes the vertex data stored in this VAO.

    Parameters

    • Optional uniforms: UniformSource

      A map of uniform variable names to their values to use when rasterizing.

    • primitive: Primitive = Primitive.TRIANGLES

      The type of primitive to rasterize.

    • offset: number = 0

      The number of elements to skip when rasterizing arrays.

    Returns void

  • Executes the given function with this vertex array object bound, then re-binds the previously-bound vertex array object.

    Type Parameters

    • T

    Parameters

    • f: ((vao) => T)

      The function to execute.

        • (vao): T
        • Parameters

          Returns T

    Returns T

    The return value of the executed function.

  • Binds the given renderbuffer.

    Parameters

    • context: Context

      The rendering context.

    • vao: null | WebGLVertexArrayObject

    Returns void

  • Gets the currently-bound vertex array object.

    Parameters

    • context: Context

      The rendering context.

    Returns null | WebGLVertexArrayObject

    The vertex array object.

  • Unbinds all vertex array objects from the given rendering context.

    Parameters

    • context: Context

      The rendering context.

    Returns void

Generated using TypeDoc