enableVertexAttribArray method

void enableVertexAttribArray(
  1. GLuint index
)

The WebGLRenderingContext method enableVertexAttribArray(), part of the WebGL API, turns on the generic vertex attribute array at the specified index into the list of attribute arrays.

Note: You can disable the attribute array by calling WebGLRenderingContext.disableVertexAttribArray.

In WebGL, values that apply to a specific vertex are stored in attributes. These are only available to the JavaScript code and the vertex shader. Attributes are referenced by an index number into the list of attributes maintained by the GPU. Some vertex attribute indices may have predefined purposes, depending on the platform and/or the GPU. Others are assigned by the WebGL layer when you create the attributes.

Either way, since attributes cannot be used unless enabled, and are disabled by default, you need to call enableVertexAttribArray() to enable individual attributes so that they can be used. Once that's been done, other methods can be used to access the attribute, including WebGLRenderingContext.vertexAttribPointer, WebGLRenderingContext.vertexAttrib, and WebGLRenderingContext.getVertexAttrib.

Implementation

external void enableVertexAttribArray(GLuint index);