Class ElementBuffer

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

Hierarchy (View Summary)

  • Buffer<Uint8Array | Uint16Array | Uint32Array>
    • ElementBuffer

Constructors

Properties

Accessors

Methods

Constructors

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

    Parameters

    • context: Context

      The rendering context.

    • data:
          | number
          | Uint8Array<ArrayBufferLike>
          | Uint16Array<ArrayBufferLike>
          | Uint32Array<ArrayBufferLike>

      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: undefined | number = ...

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

    • length: undefined | number = ...

      The length of the initial data to read into the buffer.

    Returns ElementBuffer

    UnsupportedOperationError if a buffer cannot be created.

Properties

context: Context

The rendering context.

Accessors

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

    Returns boolean

Methods

  • Replace the data in this buffer.

    Parameters

    • data:
          | Uint8Array<ArrayBufferLike>
          | Uint16Array<ArrayBufferLike>
          | Uint32Array<ArrayBufferLike>

      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.

    • Optionallength: number

      The length of the supplied data to read.

    • OptionalisHalf: boolean

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

    Returns void

  • Set the size of this buffer, clearing its data.

    Parameters

    • data: number

      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.

    • Optional_: unknown

      An unused value.

    • Optional__: unknown

      An unused value.

    • OptionalisHalf: boolean

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

    Returns void

  • Update a subset of the data in this buffer.

    Parameters

    • data:
          | Uint8Array<ArrayBufferLike>
          | Uint16Array<ArrayBufferLike>
          | Uint32Array<ArrayBufferLike>

      The data to store in this buffer.

    • Optional_: unknown

      An ignored value.

    • Optionaloffset: number

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

    • Optionallength: number

      The length of the supplied data to read.

    • Optional__: unknown

      An ignored value.

    • OptionalreplaceOffset: number

      The offset in bytes to start replacing data at.

    Returns void