1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <!DOCTYPE book PUBLIC
"-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
3 "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
4 <refentry id=
"glGetProgram">
6 <refentrytitle>glGetProgram
</refentrytitle>
7 <manvolnum>3G
</manvolnum>
10 <refname>glGetProgramiv
</refname>
11 <refpurpose>Returns a parameter from a program object
</refpurpose>
13 <refsynopsisdiv><title>C Specification
</title>
16 <funcdef>void
<function>glGetProgramiv
</function></funcdef>
17 <paramdef>GLuint
<parameter>program
</parameter></paramdef>
18 <paramdef>GLenum
<parameter>pname
</parameter></paramdef>
19 <paramdef>GLint *
<parameter>params
</parameter></paramdef>
23 <refsect1 id=
"parameters"><title>Parameters
</title>
26 <term><parameter>program
</parameter></term>
28 <para>Specifies the program object to be
33 <term><parameter>pname
</parameter></term>
35 <para>Specifies the object parameter. Accepted
37 <constant>GL_DELETE_STATUS
</constant>,
38 <constant>GL_LINK_STATUS
</constant>,
39 <constant>GL_VALIDATE_STATUS
</constant>,
40 <constant>GL_INFO_LOG_LENGTH
</constant>,
41 <constant>GL_ATTACHED_SHADERS
</constant>,
42 <constant>GL_ACTIVE_ATTRIBUTES
</constant>,
43 <constant>GL_ACTIVE_ATTRIBUTE_MAX_LENGTH
</constant>,
44 <constant>GL_ACTIVE_UNIFORMS
</constant>,
45 <constant>GL_ACTIVE_UNIFORM_BLOCKS
</constant>,
46 <constant>GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH
</constant>,
47 <constant>GL_ACTIVE_UNIFORM_MAX_LENGTH
</constant>,
48 <constant>GL_TRANSFORM_FEEDBACK_BUFFER_MODE
</constant>,
49 <constant>GL_TRANSFORM_FEEDBACK_VARYINGS
</constant>,
50 <constant>GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH
</constant>,
51 <constant>GL_GEOMETRY_VERTICES_OUT
</constant>,
52 <constant>GL_GEOMETRY_INPUT_TYPE
</constant>, and
53 <constant>GL_GEOMETRY_OUTPUT_TYPE
</constant>.
</para>
57 <term><parameter>params
</parameter></term>
59 <para>Returns the requested object parameter.
</para>
64 <refsect1 id=
"description"><title>Description
</title>
65 <para><function>glGetProgram
</function>
66 returns in
<parameter>params
</parameter>
67 the value of a parameter for a specific program object. The following parameters are defined:
</para>
71 <term><constant>GL_DELETE_STATUS
</constant></term>
75 <para> <parameter>params
</parameter> returns
76 <constant>GL_TRUE
</constant> if
77 <parameter>program
</parameter> is currently flagged
78 for deletion, and
<constant>GL_FALSE
</constant>
84 <term><constant>GL_LINK_STATUS
</constant></term>
88 <para> <parameter>params
</parameter> returns
89 <constant>GL_TRUE
</constant> if the last link
90 operation on
<parameter>program
</parameter> was
91 successful, and
<constant>GL_FALSE
</constant>
97 <term><constant>GL_VALIDATE_STATUS
</constant></term>
101 <para> <parameter>params
</parameter> returns
102 <constant>GL_TRUE
</constant> or if the last
103 validation operation on
104 <parameter>program
</parameter> was successful, and
105 <constant>GL_FALSE
</constant>
111 <term><constant>GL_INFO_LOG_LENGTH
</constant></term>
115 <para> <parameter>params
</parameter> returns the
116 number of characters in the information log for
117 <parameter>program
</parameter> including the null
118 termination character (i.e., the size of the
119 character buffer required to store the information
120 log). If
<parameter>program
</parameter> has no
121 information log, a value of
0 is
127 <term><constant>GL_ATTACHED_SHADERS
</constant></term>
131 <para> <parameter>params
</parameter> returns the
132 number of shader objects attached to
133 <parameter>program
</parameter>.
</para>
138 <term><constant>GL_ACTIVE_ATTRIBUTES
</constant></term>
142 <para> <parameter>params
</parameter> returns the
143 number of active attribute variables for
144 <parameter>program
</parameter>.
</para>
149 <term><constant>GL_ACTIVE_ATTRIBUTE_MAX_LENGTH
</constant></term>
153 <para> <parameter>params
</parameter> returns the
154 length of the longest active attribute name for
155 <parameter>program
</parameter>, including the null
156 termination character (i.e., the size of the
157 character buffer required to store the longest
158 attribute name). If no active attributes exist,
0 is
164 <term><constant>GL_ACTIVE_UNIFORMS
</constant></term>
168 <para> <parameter>params
</parameter> returns the
169 number of active uniform variables for
170 <parameter>program
</parameter>.
</para>
175 <term><constant>GL_ACTIVE_UNIFORM_MAX_LENGTH
</constant></term>
179 <para> <parameter>params
</parameter> returns the
180 length of the longest active uniform variable name
181 for
<parameter>program
</parameter>, including the
182 null termination character (i.e., the size of the
183 character buffer required to store the longest
184 uniform variable name). If no active uniform
185 variables exist,
0 is returned.
</para>
190 <term><constant>GL_TRANSFORM_FEEDBACK_BUFFER_MODE
</constant></term>
194 <para> <parameter>params
</parameter> returns a symbolic constant
195 indicating the buffer mode used when transform feedback is active.
196 This may be
<constant>GL_SEPARATE_ATTRIBS
</constant> or
197 <constant>GL_INTERLEAVED_ATTRIBS
</constant>.
</para>
202 <term><constant>GL_TRANSFORM_FEEDBACK_VARYINGS
</constant></term>
206 <para> <parameter>params
</parameter> returns the number of varying
207 variables to capture in transform feedback mode for the program.
</para>
212 <term><constant>GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH
</constant></term>
216 <para> <parameter>params
</parameter> returns the length of the longest
217 variable name to be used for transform feedback, including the null-terminator.
</para>
222 <term><constant>GL_GEOMETRY_VERTICES_OUT
</constant></term>
226 <para> <parameter>params
</parameter> returns the maximum number of vertices
227 that the geometry shader in
<parameter>program
</parameter> will output.
</para>
232 <term><constant>GL_GEOMETRY_INPUT_TYPE
</constant></term>
236 <para> <parameter>params
</parameter> returns a symbolic constant indicating
237 the primitive type accepted as input to the geometry shader contained in
238 <parameter>program
</parameter>.
</para>
243 <term><constant>GL_GEOMETRY_OUTPUT_TYPE
</constant></term>
247 <para> <parameter>params
</parameter> returns a symbolic constant indicating
248 the primitive type that will be output by the geometry shader contained
249 in
<parameter>program
</parameter>.
</para>
254 <refsect1 id=
"notes"><title>Notes
</title>
256 <constant>GL_ACTIVE_UNIFORM_BLOCKS
</constant> and
257 <constant>GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH
</constant>
258 are available only if the GL version
3.1 or greater.
261 <constant>GL_GEOMETRY_VERTICES_OUT
</constant>,
<constant>GL_GEOMETRY_INPUT_TYPE
</constant>
262 and
<constant>GL_GEOMETRY_OUTPUT_TYPE
</constant> are accepted only if the GL
263 version is
3.2 or greater.
266 <para>If an error is generated, no change is made to the
267 contents of
<parameter>params
</parameter>.
</para>
269 <refsect1 id=
"errors"><title>Errors
</title>
270 <para><constant>GL_INVALID_VALUE
</constant>
271 is generated if
<parameter>program
</parameter>
272 is not a value generated by OpenGL.
</para>
274 <para><constant>GL_INVALID_OPERATION
</constant>
275 is generated if
<parameter>program
</parameter>
276 does not refer to a program object.
</para>
278 <para><constant>GL_INVALID_OPERATION
</constant> is generated if
279 <parameter>pname
</parameter> is
<constant>GL_GEOMETRY_VERTICES_OUT
</constant>,
280 <constant>GL_GEOMETRY_INPUT_TYPE
</constant>, or
<constant>GL_GEOMETRY_OUTPUT_TYPE
</constant>,
281 and
<parameter>program
</parameter> does not contain a geometry shader.
</para>
283 <para><constant>GL_INVALID_ENUM
</constant>
284 is generated if
<parameter>pname
</parameter>
285 is not an accepted value.
</para>
288 <refsect1 id=
"associatedgets"><title>Associated Gets
</title>
289 <para><citerefentry><refentrytitle>glGetActiveAttrib
</refentrytitle></citerefentry>
290 with argument
<parameter>program
</parameter></para>
292 <para><citerefentry><refentrytitle>glGetActiveUniform
</refentrytitle></citerefentry>
293 with argument
<parameter>program
</parameter></para>
295 <para><citerefentry><refentrytitle>glGetAttachedShaders
</refentrytitle></citerefentry>
296 with argument
<parameter>program
</parameter></para>
298 <para><citerefentry><refentrytitle>glGetProgramInfoLog
</refentrytitle></citerefentry>
299 with argument
<parameter>program
</parameter></para>
301 <para><citerefentry><refentrytitle>glIsProgram
</refentrytitle></citerefentry>
302 <parameter></parameter></para>
304 <refsect1 id=
"seealso"><title>See Also
</title>
305 <para><citerefentry><refentrytitle>glAttachShader
</refentrytitle></citerefentry>,
306 <citerefentry><refentrytitle>glCreateProgram
</refentrytitle></citerefentry>,
307 <citerefentry><refentrytitle>glDeleteProgram
</refentrytitle></citerefentry>,
308 <citerefentry><refentrytitle>glGetShader
</refentrytitle></citerefentry>,
309 <citerefentry><refentrytitle>glLinkProgram
</refentrytitle></citerefentry>,
310 <citerefentry><refentrytitle>glValidateProgram
</refentrytitle></citerefentry></para>
312 <refsect1 id=
"Copyright"><title>Copyright
</title>
314 Copyright
<trademark class=
"copyright"></trademark> 2003-
2005 3Dlabs Inc. Ltd.
315 Copyright
<trademark class=
"copyright"></trademark> 2010 Khronos Group.
316 This material may be distributed subject to the terms and conditions set forth in
317 the Open Publication License, v
1.0,
8 June
1999.
318 <ulink url=
"http://opencontent.org/openpub/">http://opencontent.org/openpub/
</ulink>.