WebGL2RenderingContext: phương thức bindVertexArray()

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2021.

Note: This feature is available in Web Workers.

Phương thức WebGL2RenderingContext.bindVertexArray() của WebGL 2 API liên kết một đối tượng WebGLVertexArrayObject đã cho với bộ đệm.

Cú pháp

js
bindVertexArray(vertexArray)

Tham số

vertexArray

Một đối tượng WebGLVertexArrayObject (VAO) để liên kết.

Giá trị trả về

None (undefined).

Ví dụ

js
const vao = gl.createVertexArray();
gl.bindVertexArray(vao);

// …

// các lệnh gọi bindBuffer hoặc vertexAttribPointer
// sẽ được "ghi lại" trong VAO

// …

Đặc tả kỹ thuật

Specification
WebGL 2.0 Specification
# 3.7.17

Tương thích trình duyệt

Xem thêm