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_MAX_LENGTH
</constant>.
</para>
49 <term><parameter>params
</parameter></term>
51 <para>Returns the requested object parameter.
</para>
56 <refsect1 id=
"description"><title>Description
</title>
57 <para><function>glGetProgram
</function>
58 returns in
<parameter>params
</parameter>
59 the value of a parameter for a specific program object. The following parameters are defined:
</para>
63 <term><constant>GL_DELETE_STATUS
</constant></term>
67 <para> <parameter>params
</parameter> returns
68 <constant>GL_TRUE
</constant> if
69 <parameter>program
</parameter> is currently flagged
70 for deletion, and
<constant>GL_FALSE
</constant>
76 <term><constant>GL_LINK_STATUS
</constant></term>
80 <para> <parameter>params
</parameter> returns
81 <constant>GL_TRUE
</constant> if the last link
82 operation on
<parameter>program
</parameter> was
83 successful, and
<constant>GL_FALSE
</constant>
89 <term><constant>GL_VALIDATE_STATUS
</constant></term>
93 <para> <parameter>params
</parameter> returns
94 <constant>GL_TRUE
</constant> or if the last
95 validation operation on
96 <parameter>program
</parameter> was successful, and
97 <constant>GL_FALSE
</constant>
103 <term><constant>GL_INFO_LOG_LENGTH
</constant></term>
107 <para> <parameter>params
</parameter> returns the
108 number of characters in the information log for
109 <parameter>program
</parameter> including the null
110 termination character (i.e., the size of the
111 character buffer required to store the information
112 log). If
<parameter>program
</parameter> has no
113 information log, a value of
0 is
119 <term><constant>GL_ATTACHED_SHADERS
</constant></term>
123 <para> <parameter>params
</parameter> returns the
124 number of shader objects attached to
125 <parameter>program
</parameter>.
</para>
130 <term><constant>GL_ACTIVE_ATTRIBUTES
</constant></term>
134 <para> <parameter>params
</parameter> returns the
135 number of active attribute variables for
136 <parameter>program
</parameter>.
</para>
141 <term><constant>GL_ACTIVE_ATTRIBUTE_MAX_LENGTH
</constant></term>
145 <para> <parameter>params
</parameter> returns the
146 length of the longest active attribute name for
147 <parameter>program
</parameter>, including the null
148 termination character (i.e., the size of the
149 character buffer required to store the longest
150 attribute name). If no active attributes exist,
0 is
156 <term><constant>GL_ACTIVE_UNIFORMS
</constant></term>
160 <para> <parameter>params
</parameter> returns the
161 number of active uniform variables for
162 <parameter>program
</parameter>.
</para>
167 <term><constant>GL_ACTIVE_UNIFORM_MAX_LENGTH
</constant></term>
171 <para> <parameter>params
</parameter> returns the
172 length of the longest active uniform variable name
173 for
<parameter>program
</parameter>, including the
174 null termination character (i.e., the size of the
175 character buffer required to store the longest
176 uniform variable name). If no active uniform
177 variables exist,
0 is returned.
</para>
182 <refsect1 id=
"notes"><title>Notes
</title>
183 <para><function>glGetProgram
</function> is available only if the
184 GL version is
2.0 or greater.
</para>
186 <para>If an error is generated, no change is made to the
187 contents of
<parameter>params
</parameter>.
</para>
189 <refsect1 id=
"errors"><title>Errors
</title>
190 <para><constant>GL_INVALID_VALUE
</constant>
191 is generated if
<parameter>program
</parameter>
192 is not a value generated by OpenGL.
</para>
194 <para><constant>GL_INVALID_OPERATION
</constant>
195 is generated if
<parameter>program
</parameter>
196 does not refer to a program object.
</para>
198 <para><constant>GL_INVALID_ENUM
</constant>
199 is generated if
<parameter>pname
</parameter>
200 is not an accepted value.
</para>
202 <para><constant>GL_INVALID_OPERATION
</constant> is generated if
203 <function>glGetProgram
</function> is executed between the
205 <citerefentry><refentrytitle>glBegin
</refentrytitle></citerefentry>
206 and the corresponding execution of
207 <citerefentry><refentrytitle>glEnd
</refentrytitle></citerefentry>.
</para>
209 <refsect1 id=
"associatedgets"><title>Associated Gets
</title>
210 <para><citerefentry><refentrytitle>glGetActiveAttrib
</refentrytitle></citerefentry>
211 with argument
<parameter>program
</parameter></para>
213 <para><citerefentry><refentrytitle>glGetActiveUniform
</refentrytitle></citerefentry>
214 with argument
<parameter>program
</parameter></para>
216 <para><citerefentry><refentrytitle>glGetAttachedShaders
</refentrytitle></citerefentry>
217 with argument
<parameter>program
</parameter></para>
219 <para><citerefentry><refentrytitle>glGetProgramInfoLog
</refentrytitle></citerefentry>
220 with argument
<parameter>program
</parameter></para>
222 <para><citerefentry><refentrytitle>glIsProgram
</refentrytitle></citerefentry>
223 <parameter></parameter></para>
225 <refsect1 id=
"seealso"><title>See Also
</title>
226 <para><citerefentry><refentrytitle>glAttachShader
</refentrytitle></citerefentry>,
227 <citerefentry><refentrytitle>glCreateProgram
</refentrytitle></citerefentry>,
228 <citerefentry><refentrytitle>glDeleteProgram
</refentrytitle></citerefentry>,
229 <citerefentry><refentrytitle>glGetShader
</refentrytitle></citerefentry>,
230 <citerefentry><refentrytitle>glLinkProgram
</refentrytitle></citerefentry>,
231 <citerefentry><refentrytitle>glValidateProgram
</refentrytitle></citerefentry></para>
233 <refsect1 id=
"Copyright"><title>Copyright
</title>
235 Copyright
<trademark class=
"copyright"></trademark> 2003-
2005 3Dlabs Inc. Ltd.
236 This material may be distributed subject to the terms and conditions set forth in
237 the Open Publication License, v
1.0,
8 June
1999.
238 <ulink url=
"http://opencontent.org/openpub/">http://opencontent.org/openpub/
</ulink>.