From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../getprogramparameter/index.html | 89 ++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 files/zh-cn/web/api/webglrenderingcontext/getprogramparameter/index.html (limited to 'files/zh-cn/web/api/webglrenderingcontext/getprogramparameter/index.html') diff --git a/files/zh-cn/web/api/webglrenderingcontext/getprogramparameter/index.html b/files/zh-cn/web/api/webglrenderingcontext/getprogramparameter/index.html new file mode 100644 index 0000000000..91cba90cc1 --- /dev/null +++ b/files/zh-cn/web/api/webglrenderingcontext/getprogramparameter/index.html @@ -0,0 +1,89 @@ +--- +title: WebGLRenderingContext.getProgramParameter() +slug: Web/API/WebGLRenderingContext/getProgramParameter +translation_of: Web/API/WebGLRenderingContext/getProgramParameter +--- +
{{APIRef("WebGL")}}
+ +

WebGLRenderingContext.getProgramParameter() 方法返回WebGLProgram的信息。

+ +

语法

+ +
any gl.getProgramParameter(program, pname);
+
+ +

参数

+ +
+
program
+
A {{domxref("WebGLProgram")}} to get parameter information from.
+
pname
+
A {{domxref("Glenum")}} specifying the information to query. Possible values: +
    +
  • gl.DELETE_STATUS: Returns a {{domxref("GLboolean")}} indicating whether or not the program is flagged for deletion.
  • +
  • gl.LINK_STATUS: Returns a {{domxref("GLboolean")}} indicating whether or not the last link operation was successful.
  • +
  • gl.VALIDATE_STATUS: Returns a {{domxref("GLboolean")}} indicating whether or not the last validation operation was successful.
  • +
  • gl.ATTACHED_SHADERS: Returns a {{domxref("GLint")}} indicating the number of attached shaders to a program.
  • +
  • gl.ACTIVE_ATTRIBUTES: Returns a {{domxref("GLint")}} indicating the number of active attribute variables to a program.
  • +
  • gl.ACTIVE_UNIFORMS: Returns a {{domxref("GLint")}} indicating the number of active uniform variables to a program.
  • +
  • When using a {{domxref("WebGL2RenderingContext", "WebGL 2 context", "", 1)}}, the following values are available additionally: +
      +
    • gl.TRANSFORM_FEEDBACK_BUFFER_MODE: Returns a {{domxref("GLenum")}} indicating the buffer mode when transform feedback is active. May be gl.SEPARATE_ATTRIBS or gl.INTERLEAVED_ATTRIBS.
    • +
    • gl.TRANSFORM_FEEDBACK_VARYINGS: Returns a {{domxref("GLint")}} indicating the number of varying variables to capture in transform feedback mode.
    • +
    • gl.ACTIVE_UNIFORM_BLOCKS: Returns a {{domxref("GLint")}} indicating the number of uniform blocks containing active uniforms.
    • +
    +
  • +
+
+
+ +

返回值

+ +

Returns the requested program information (as specified with pname).

+ +

例子

+ +
gl.getProgramParameter(program, gl.DELETE_STATUS);
+
+ +

Specifications

+ + + + + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('WebGL', "#5.14.9", "getProgramParameter")}}{{Spec2('WebGL')}}Initial definition.
{{SpecName('OpenGL ES 2.0', "glGetProgramiv.xml", "glGetProgramiv")}}{{Spec2('OpenGL ES 2.0')}}Man page of the (similar) OpenGL API.
{{SpecName('WebGL2', "#3.7.7", "getProgramParameter")}}{{Spec2('WebGL2')}}Adds new pname values:
+ gl.TRANSFORM_FEEDBACK_BUFFER_MODE,
+ gl.TRANSFORM_FEEDBACK_VARYINGS,
+ gl.ACTIVE_UNIFORM_BLOCKS
+ +

Browser compatibility

+ + + +

{{Compat("api.WebGLRenderingContext.getProgramParameter")}}

+ +

See also

+ + -- cgit v1.2.3-54-g00ecf