HTML: Markup language
CSS: Styling language
JavaScript: Scripting language
Web APIs: Programming interfaces
All web technology
Learn web development
Discover our tools
Get to know MDN better
此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。
View in English Always switch to English
自 2015年7月 起,此特性已在主流浏览器中得到支持,可在大多数设备和浏览器版本中正常使用。
WebGLRenderingContext.getAttribLocation() 方法返回了给定WebGLProgram对象中某属性的下标指向位置。
WebGLRenderingContext.getAttribLocation()
WebGLProgram
GLint gl.getAttribLocation(program, name);
一个包含了属性参数的WebGLProgram 对象。
需要获取下标指向位置的 DOMString 属性参数名
DOMString
表明属性位置的下标 GLint 数字,如果找不到该属性则返回 -1。
GLint
gl.getAttribLocation(program, "vColor");
启用 JavaScript 以查看此浏览器兼容性表。
WebGLRenderingContext.getUniformLocation()