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.
getQueryParameter(query, pname)
-
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.
-
Depends on the pname
parameter, either a {{domxref("WebGL_API/Types", "GLuint")}} or a
{{domxref("WebGL_API/Types", "GLboolean")}}.
const query = gl.createQuery();
gl.beginQuery(gl.ANY_SAMPLES_PASSED, query);
const result = gl.getQueryParameter(query, gl.QUERY_RESULT);
{{Specifications}}
{{Compat}}
- {{domxref("WebGLQuery")}}