Skip to content

Latest commit

 

History

History
60 lines (41 loc) · 1.39 KB

File metadata and controls

60 lines (41 loc) · 1.39 KB
title short-title slug page-type browser-compat
WebGL2RenderingContext: getQueryParameter() method
getQueryParameter()
Web/API/WebGL2RenderingContext/getQueryParameter
web-api-instance-method
api.WebGL2RenderingContext.getQueryParameter

{{APIRef("WebGL")}}

The WebGL2RenderingContext.getQueryParameter() method of the WebGL 2 API returns parameter information of a {{domxref("WebGLQuery")}} object.

Syntax

getQueryParameter(query, pname)

Parameters

  • query

    • : A {{domxref("WebGLQuery")}} object.
  • pname

    • : A {{domxref("WebGL_API/Types", "GLenum")}} specifying which information to return. Possible values:

      • gl.QUERY_RESULT
        • : Returns a {{domxref("WebGL_API/Types", "GLuint")}} containing the query result.
      • gl.QUERY_RESULT_AVAILABLE
        • : Returns a {{domxref("WebGL_API/Types", "GLboolean")}} indicating whether or not a query result is available.

Return value

Depends on the pname parameter, either a {{domxref("WebGL_API/Types", "GLuint")}} or a {{domxref("WebGL_API/Types", "GLboolean")}}.

Examples

const query = gl.createQuery();
gl.beginQuery(gl.ANY_SAMPLES_PASSED, query);

const result = gl.getQueryParameter(query, gl.QUERY_RESULT);

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • {{domxref("WebGLQuery")}}