dom / latest / webgl2renderingcontext / createvertexarray.html /

WebGL2RenderingContext.createVertexArray()

The WebGL2RenderingContext.createVertexArray() method of the WebGL 2 API creates and initializes a WebGLVertexArrayObject object that represents a vertex array object (VAO) pointing to vertex array data and which provides names for different sets of vertex data.

Syntax

createVertexArray()

Parameters

None.

Return value

A WebGLVertexArrayObject representing a vertex array object (VAO) which points to vertex array data.

Examples

var vao = gl.createVertexArray();
gl.bindVertexArray(vao);

// ...
// calls to bindBuffer or vertexAttribPointer
// which will be "recorded" in the VAO
// ...

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
createVertexArray
56
79
51
No
43
15
58
58
51
43
15
7.0

See also

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/createVertexArray