BufferType

View source

Selects a WebGL buffer binding target.

Pass a member to WebGLRenderingContext#bindBuffer or use it with createBuffer and createBufferData. The CopyRead, CopyWrite, Uniform, PixelPack, and PixelUnpack targets require the WebGL 2 buffer APIs; Array and ElementArray are the common vertex and index-buffer targets.

Examples

import { BufferType, DrawUsage, createBufferData } from '@wimaengine/render-webgl'

const vertexBuffer = createBufferData(
  gl,
  BufferType.Array,
  new Float32Array([0, 0, 0]),
  DrawUsage.Static
)

Variants


Array

View source

Vertex-attribute data target (0x8892, ARRAY_BUFFER).

ElementArray

View source

Element-index data target (0x8893, ELEMENT_ARRAY_BUFFER).

CopyRead

View source

WebGL 2 source target for buffer-to-buffer copy operations (0x8F36).

CopyWrite

View source

WebGL 2 destination target for buffer-to-buffer copy operations (0x8F37).

Uniform

View source

WebGL 2 uniform-buffer target (0x8A11).

PixelPack

View source

WebGL 2 target for reading pixel data into a buffer (0x88EB).

PixelUnpack

View source

WebGL 2 target for unpacking pixel data from a buffer (0x88EC).