Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

bindAttribLocation method

Binds a generic vertex index to a user-defined attribute variable.




WebGLRenderingContext.bindAttribLocation(program, index, name);


program [in]

Type: WebGLProgram

Program object to bind.

index [in]

Type: number

The index of the generic vertex to bind.

name [in]

Type: String

Name of the user variable to a bind to the generic vertex index.

Return value

This method does not return a value.


More than one name can be bound to the same vertex index, but multiple indexes cannot be bound to the same name.

If name is a matrix attribute, then index points to the first column of the matrix. Additional matrix columns are automatically bound to index+1, index+2, and so forth based on matrix variable (mat2,mat3,mat4).

WebGL errorDescription
gl.INVALID_VALUEIf index is greater than or equal to gl.MAX_VERTEX_ATTRIBS.
gl.INVALID_VALUEIf program is not generated by WebGL.
gl.INVALID_OPERATIONIf name starts with the reserved prefix gl_.
gl.INVALID_OPERATIONIf program isn't a program object.


See also




© 2015 Microsoft