WebGLRenderingContext: getAttribLocation() method
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
Note: This feature is available in Web Workers.
Phương thức WebGLRenderingContext.getAttribLocation() của WebGL API trả về vị trí của một biến thuộc tính trong một WebGLProgram nhất định.
Cú pháp
js
getAttribLocation(program, name)
Thông số
program-
Một
WebGLProgramchứa biến thuộc tính. name-
Một chuỗi xác định tên của biến thuộc tính có vị trí để có được.
Giá trị trả về
Một số GLint cho biết vị trí của tên biến nếu tìm thấy. Trả về -1 nếu không.
Ví dụ
js
gl.getAttribLocation(program, "vColor");
Thông số kỹ thuật
| Specification |
|---|
| WebGL Specification> # 5.14.10> |