Represents a WebGL ArrayBuffer.

Constructors

  • Creates a WebGL ArrayBuffer.

    Parameters

    • gl: WebGL2RenderingContext
    • type: any
    • data: any
    • numItems: number
    • itemSize: number
    • usage: number
    • Optionalnormalized: boolean
    • Optionalstride: number
    • Optionaloffset: number

    Returns WebGLArrayBuf

Properties

allocated: boolean

Allocated yet?

dataLength: number
gl: WebGL2RenderingContext

WebGL2 rendering context.

handle: WebGLBuffer

Hand to a WebGLBuffer.

isInteger: boolean

True if the values are integers. Used to select vertexAttribIPointer vs vertexAttribPointer.

itemByteSize: number

Byte size of each item.

itemSize: number

Size of each item.

itemType: number

The ArrayBuffer's item type.

length: number

The ArrayBuffer type.

normalized: boolean

True when ArrayBuffer values are normalized.

numItems: number

Number of items in the ArrayBuffer.

offset: number
stride: number

The ArrayBuffer stride.

type: any

The ArrayBuffer type.

usage: number

A GLenum specifying the intended usage pattern of the data store for optimization purposes. Possible values:

  • gl.STATIC_DRAW : The contents are intended to be specified once by the application, and used many times as the source for WebGL drawing and image specification commands.
  • gl.DYNAMIC_DRAW : The contents are intended to be respecified repeatedly by the application, and used many times as the source for WebGL drawing and image specification commands.
  • gl.STREAM_DRAW : The contents are intended to be specified once by the application, and used at most a few times as the source for WebGL drawing and image specification commands.
  • gl.STATIC_READ : The contents are intended to be specified once by reading data from WebGL, and queried many times by the application.
  • gl.DYNAMIC_READ : The contents are intended to be respecified repeatedly by reading data from WebGL, and queried many times by the application.
  • gl.STREAM_READ : The contents are intended to be specified once by reading data from WebGL, and queried at most a few times by the application
  • gl.STATIC_COPY : The contents are intended to be specified once by reading data from WebGL, and used many times as the source for WebGL drawing and image specification commands.
  • gl.DYNAMIC_COPY : The contents are intended to be respecified repeatedly by reading data from WebGL, and used many times as the source for WebGL drawing and image specification commands.
  • gl.STREAM_COPY : The contents are intended to be specified once by reading data from WebGL, and used at most a few times as the source for WebGL drawing and image specification commands.

Methods