createVertexArray()
ts
function createVertexArray(
gl,
program,
attributes,
indexOffset?
): VertexArrayBindings;Defined in: createVertexArray.js:38
Creates the vertex array(s) for a set of attribute definitions and binds each attribute's location on program, which must not be linked yet.
With transform feedback attributes it builds two vertex arrays and two transform feedback objects that ping-pong: vertex array 0 reads the buffers that transform feedback 0 writes, and the same for 1. Only the transform feedback buffers are doubled; every other attribute shares one buffer.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
gl | WebGL2RenderingContext | undefined | The WebGL2 context. |
program | WebGLProgram | undefined | An unlinked program, from createProgram. |
attributes | Record<string, Attribute> | undefined | - |
indexOffset? | number | 0 | Added to every default attribute location. |