An array of binary data to be used as a vertex buffer object. Must contain unsigned integers.

Hierarchy (view full)

Constructors

Accessors

Methods

Constructors

  • Create a buffer to be used as anything other than an element array buffer.

    Parameters

    • context: Context

      The rendering context.

    • data: number | ArrayBufferView

      The initial data contained in this buffer or the size of this buffer's data store in bytes.

    • usage: BufferUsage = BufferUsage.STATIC_DRAW

      The intended usage of the buffer.

    • offset: number = 0

      The index of the element to start reading the buffer at.

    • isHalf: boolean = false

      Whether or not the data contains half floats if it contains floats.

    Returns Vbo

    UnsupportedOperationError if a buffer cannot be created.

    createBuffer

Accessors

  • get isHalf(): boolean
  • Whether or not this buffer contains 16-bit floating-point data if it contains floating-point data.

    Returns boolean

  • get offset(): number
  • The element index offset at which to start reading this buffer.

    Returns number

Methods

  • Sets the data in this buffer.

    Parameters

    • data: number | ArrayBufferView

      The data to store in this buffer or the size to set this buffer's data store to in bytes.

    • Optionalusage: BufferUsage

      The intended usage of the buffer.

    • Optionaloffset: number

      The index of the element to start reading the supplied data at.

    • OptionalisHalf: boolean

      Whether or not the data contains 16-bit floating-point data if it contains floating-point data.

    Returns void

  • Updates a subset of the data in this buffer.

    Parameters

    • data: ArrayBufferView

      The data to store in this buffer.

    • _: never

      An ignored value.

    • offset: number

      The index of the element to start reading the supplied data at.

    • __: never

      An ignored value.

    • replaceOffset: number

      The offset in bytes to start replacing data at.

    Returns void