Expand Minimize

getParameter method

Returns the natural type value for a constant parameter.

IE11

 

Syntax

var retVal = WebGLRenderingContext.getParameter(pname);

Parameters

pname [in]

Type: any

Parameter to look up. Refer to remarks section for full list.

Return value

Type: any

Type of parameter (see below).

Remarks

Returned values can be one of the following.

pnamereturned type
gl.ACTIVE_TEXTURENumber
gl.ALIASED_LINE_WIDTH_RANGEFloat32Array (with 2 elements)
gl.ALIASED_POINT_SIZE_RANGEFloat32Array (with 2 elements)
gl.ALPHA_BITSNumber
gl.ARRAY_BUFFER_BINDINGWebGLBuffer
gl.BLENDBoolean
gl.BLEND_COLORFloat32Array (with 4 values)
gl.BLEND_DST_ALPHANumber
gl.BLEND_DST_RGBNumber
gl.BLEND_EQUATION_ALPHANumber
gl.BLEND_EQUATION_RGBNumber
gl.BLEND_SRC_ALPHANumber
gl.BLEND_SRC_RGBNumber
gl.BLUE_BITSNumber
gl.COLOR_CLEAR_VALUEFloat32Array (with 4 values)
gl.COLOR_WRITEMASKBoolean[] (with 4 values)
gl.COMPRESSED_TEXTURE_FORMATSUint32Array
gl.CULL_FACEBoolean
gl.CULL_FACE_MODENumber
gl.CURRENT_PROGRAMWebGLProgram
gl.DEPTH_BITSNumber
gl.DEPTH_CLEAR_VALUENumber
gl.DEPTH_FUNCNumber
gl.DEPTH_RANGEFloat32Array (with 2 elements)
gl.DEPTH_TESTBoolean
gl.DEPTH_WRITEMASKBoolean
gl.DITHERBoolean
gl.ELEMENT_ARRAY_BUFFER_BINDINGWebGLBuffer
gl.FRAMEBUFFER_BINDINGWebGLFramebuffer
gl.FRONT_FACENumber
gl.GENERATE_MIPMAP_HINTNumber
gl.GREEN_BITSNumber
gl.LINE_WIDTHNumber
gl.MAX_TEXTURE_MAX_ANISOTROPY_EXTNumber
gl.MAX_COMBINED_TEXTURE_IMAGE_UNITSNumber
gl.MAX_CUBE_MAP_TEXTURE_SIZENumber
gl.MAX_FRAGMENT_UNIFORM_VECTORSNumber
gl.MAX_RENDERBUFFER_SIZENumber
gl.MAX_TEXTURE_IMAGE_UNITSNumber
gl.MAX_TEXTURE_SIZENumber
gl.MAX_VARYING_VECTORSNumber
gl.MAX_VERTEX_ATTRIBSNumber
gl.MAX_VERTEX_TEXTURE_IMAGE_UNITSNumber
gl.MAX_VERTEX_UNIFORM_VECTORSNumber
gl.MAX_VIEWPORT_DIMSInt32Array (with 2 elements)
gl.PACK_ALIGNMENTNumber
gl.POLYGON_OFFSET_FACTORNumber
gl.POLYGON_OFFSET_FILLBoolean
gl.POLYGON_OFFSET_UNITSNumber
gl.RED_BITSNumber
gl.RENDERBUFFER_BINDINGWebGLRenderbuffer
gl.RENDERERString
gl.SAMPLE_BUFFERSNumber
gl.SAMPLE_COVERAGE_INVERTBoolean
gl.SAMPLE_COVERAGE_VALUENumber
gl.SAMPLESNumber
gl.SCISSOR_BOXInt32Array (with 4 elements)
gl.SCISSOR_TESTBoolean
gl.SHADING_LANGUAGE_VERSIONString
gl.STENCIL_BACK_FAILNumber
gl.STENCIL_BACK_FUNCNumber
gl.STENCIL_BACK_PASS_DEPTH_FAILNumber
gl.STENCIL_BACK_PASS_DEPTH_PASSNumber
gl.STENCIL_BACK_REFNumber
gl.STENCIL_BACK_VALUE_MASKNumber
gl.STENCIL_BACK_WRITEMASKNumber
gl.STENCIL_BITSNumber
gl.STENCIL_CLEAR_VALUENumber
gl.STENCIL_FAILNumber
gl.STENCIL_FUNCNumber
gl.STENCIL_PASS_DEPTH_FAILNumber
gl.STENCIL_PASS_DEPTH_PASSNumber
gl.STENCIL_REFNumber
gl.STENCIL_TESTBoolean
gl.STENCIL_VALUE_MASKNumber
gl.STENCIL_WRITEMASKNumber
gl.SUBPIXEL_BITSNumber
gl.TEXTURE_BINDING_2DWebGLTexture
gl.TEXTURE_BINDING_CUBE_MAPWebGLTexture
gl.UNPACK_ALIGNMENTNumber
gl.UNPACK_COLORSPACE_CONVERSION_WEBGLNumber
gl.UNPACK_FLIP_Y_WEBGLBoolean
gl.UNPACK_PREMULTIPLY_ALPHA_WEBGLBoolean
gl.VENDORString
gl.VERSIONString
gl.VIEWPORTInt32Array (with 4 elements)

 

As an example, setting a stencil function on a front-facing stencil buffer will update the STENCIL_FUNC parameter.

Note  gl.COMPRESSED_TEXTURE_FORMATS always returns an empty Uint32Array.

WebGL ErrorDescription
gl.INVALID_ENUMIf pname isn't an accepted value.

 

Returns a null when a gl.INVALID_ENUM error occurs.

See also

WebGLRenderingContext

 

 

Show:
© 2014 Microsoft