--- title: WebGLRenderingContext.getAttribLocation() slug: Web/API/WebGLRenderingContext/getAttribLocation tags: - API - Méthode - Reference - WebGL - WebGLRenderingContext translation_of: Web/API/WebGLRenderingContext/getAttribLocation ---
La méthode WebGLRenderingContext.getAttribLocation()
de l'API WebGL retourne l'emplacement d'une variable d'attribut dans le {{domxref("WebGLProgram")}} indiqué.
GLint gl.getAttribLocation(programme, nom);
Un nombre {{domxref("GLint")}} indiquant l'emplacement du nom de la variable si trouvé. Retourne -1 sinon.
gl.getAttribLocation(programme, 'vColor');
Spécification | Statut | Commentaire |
---|---|---|
{{SpecName('WebGL', "#5.14.10", "getAttribLocation")}} | {{Spec2('WebGL')}} | Définition initiale. |
{{SpecName('OpenGL ES 2.0', "glGetAttribLocation.xml", "glGetAttribLocation")}} | {{Spec2('OpenGL ES 2.0')}} | Page principale de l'API OpenGL. |
{{Compat("api.WebGLRenderingContext.getAttribLocation")}}