--- title: WebGLRenderingContext.getAttribLocation() slug: Web/API/WebGLRenderingContext/getAttribLocation translation_of: Web/API/WebGLRenderingContext/getAttribLocation ---
Die Methode WebGLRenderingContext.getAttribLocation()
aus der WebGL API gibt die Position einer Attribut Variable innerhalb eines gegebenen {{domxref("WebGLProgram")}} zurück.
GLint gl.getAttribLocation(program, name);
Wenn gefunden, wird die Position der Variable als {{domxref("GLint")}}, andernfalls -1 zurückgegeben.
gl.getAttribLocation(program, 'vColor');
Spezifikation | Status | Kommentar |
---|---|---|
{{SpecName('WebGL', "#5.14.10", "getAttribLocation")}} | {{Spec2('WebGL')}} | Ursprüngliche Definition. |
{{SpecName('OpenGL ES 2.0', "glGetAttribLocation.xml", "glGetAttribLocation")}} | {{Spec2('OpenGL ES 2.0')}} | Hauptseite der OpenGL API. |
{{Compat("api.WebGLRenderingContext.getAttribLocation")}}