Back to Content

WebGLRenderingContext: getVertexAttribOffset() method

files/en-us/web/api/webglrenderingcontext/getvertexattriboffset/index.md

latest851 B
Original Source

{{APIRef("WebGL")}}{{AvailableInWorkers}}

The WebGLRenderingContext.getVertexAttribOffset() method of the WebGL API returns the address of a specified vertex attribute.

Syntax

js-nolint
getVertexAttribOffset(index, pname)

Parameters

  • index
    • : A {{domxref("WebGL_API/Types", "GLuint")}} specifying the index of the vertex attribute.
  • pname
    • : A {{domxref("WebGL_API/Types", "GLenum")}} which must be gl.VERTEX_ATTRIB_ARRAY_POINTER.

Return value

A {{domxref("WebGL_API/Types", "GLintptr")}} indicating the address of the vertex attribute.

Examples

js
gl.getVertexAttribOffset(i, gl.VERTEX_ATTRIB_ARRAY_POINTER);

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • {{domxref("WebGLRenderingContext.vertexAttribPointer()")}}