WebGLRenderingContext.getAttribLocation()
WebGL API の WebGLRenderingContext.getAttribLocation()
メソッドは指定されたWebGLProgram
(en-US)内の属性の場所を返します。
構文
GLint gl.getAttribLocation(program, name);
引数
- program
- 属性の変数を含む
WebGLProgram
(en-US) - name
- 場所を取得する属性の変数名を指定する
DOMString
返り値
見つかった場合、変数名の場所を示すGLint
(en-US)番号を、それ以外の場合は-1を返します。
例
gl.getAttribLocation(program, 'vColor');
仕様策定状況
Specification | Status | Comment |
---|---|---|
WebGL 1.0 getAttribLocation の定義 |
勧告 | 初回定義 |
OpenGL ES 2.0 glGetAttribLocation の定義 |
標準 | OpenGL API のマニュアルページ |
ブラウザーの対応
BCD tables only load in the browser