Commit | Line | Data |
---|---|---|
7faf1d71 AW |
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"> | |
5 | <refmeta> | |
6 | <refentrytitle>glGetProgram</refentrytitle> | |
7 | <manvolnum>3G</manvolnum> | |
8 | </refmeta> | |
9 | <refnamediv> | |
10 | <refname>glGetProgramiv</refname> | |
11 | <refpurpose>Returns a parameter from a program object</refpurpose> | |
12 | </refnamediv> | |
13 | <refsynopsisdiv><title>C Specification</title> | |
14 | <funcsynopsis> | |
15 | <funcprototype> | |
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> | |
20 | </funcprototype> | |
21 | </funcsynopsis> | |
22 | </refsynopsisdiv> | |
23 | <refsect1 id="parameters"><title>Parameters</title> | |
24 | <variablelist> | |
25 | <varlistentry> | |
26 | <term><parameter>program</parameter></term> | |
27 | <listitem> | |
28 | <para>Specifies the program object to be | |
29 | queried.</para> | |
30 | </listitem> | |
31 | </varlistentry> | |
32 | <varlistentry> | |
33 | <term><parameter>pname</parameter></term> | |
34 | <listitem> | |
35 | <para>Specifies the object parameter. Accepted | |
36 | symbolic names are | |
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> | |
54 | </listitem> | |
55 | </varlistentry> | |
56 | <varlistentry> | |
57 | <term><parameter>params</parameter></term> | |
58 | <listitem> | |
59 | <para>Returns the requested object parameter.</para> | |
60 | </listitem> | |
61 | </varlistentry> | |
62 | </variablelist> | |
63 | </refsect1> | |
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> | |
68 | ||
69 | <variablelist> | |
70 | <varlistentry> | |
71 | <term><constant>GL_DELETE_STATUS</constant></term> | |
72 | <listitem> | |
73 | <para> | |
74 | </para> | |
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> | |
79 | otherwise.</para> | |
80 | </listitem> | |
81 | </varlistentry> | |
82 | ||
83 | <varlistentry> | |
84 | <term><constant>GL_LINK_STATUS</constant></term> | |
85 | <listitem> | |
86 | <para> | |
87 | </para> | |
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> | |
92 | otherwise.</para> | |
93 | </listitem> | |
94 | </varlistentry> | |
95 | ||
96 | <varlistentry> | |
97 | <term><constant>GL_VALIDATE_STATUS</constant></term> | |
98 | <listitem> | |
99 | <para> | |
100 | </para> | |
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> | |
106 | otherwise.</para> | |
107 | </listitem> | |
108 | </varlistentry> | |
109 | ||
110 | <varlistentry> | |
111 | <term><constant>GL_INFO_LOG_LENGTH</constant></term> | |
112 | <listitem> | |
113 | <para> | |
114 | </para> | |
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 | |
122 | returned.</para> | |
123 | </listitem> | |
124 | </varlistentry> | |
125 | ||
126 | <varlistentry> | |
127 | <term><constant>GL_ATTACHED_SHADERS</constant></term> | |
128 | <listitem> | |
129 | <para> | |
130 | </para> | |
131 | <para> <parameter>params</parameter> returns the | |
132 | number of shader objects attached to | |
133 | <parameter>program</parameter>.</para> | |
134 | </listitem> | |
135 | </varlistentry> | |
136 | ||
137 | <varlistentry> | |
138 | <term><constant>GL_ACTIVE_ATTRIBUTES</constant></term> | |
139 | <listitem> | |
140 | <para> | |
141 | </para> | |
142 | <para> <parameter>params</parameter> returns the | |
143 | number of active attribute variables for | |
144 | <parameter>program</parameter>.</para> | |
145 | </listitem> | |
146 | </varlistentry> | |
147 | ||
148 | <varlistentry> | |
149 | <term><constant>GL_ACTIVE_ATTRIBUTE_MAX_LENGTH</constant></term> | |
150 | <listitem> | |
151 | <para> | |
152 | </para> | |
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 | |
159 | returned.</para> | |
160 | </listitem> | |
161 | </varlistentry> | |
162 | ||
163 | <varlistentry> | |
164 | <term><constant>GL_ACTIVE_UNIFORMS</constant></term> | |
165 | <listitem> | |
166 | <para> | |
167 | </para> | |
168 | <para> <parameter>params</parameter> returns the | |
169 | number of active uniform variables for | |
170 | <parameter>program</parameter>.</para> | |
171 | </listitem> | |
172 | </varlistentry> | |
173 | ||
174 | <varlistentry> | |
175 | <term><constant>GL_ACTIVE_UNIFORM_MAX_LENGTH</constant></term> | |
176 | <listitem> | |
177 | <para> | |
178 | </para> | |
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> | |
186 | </listitem> | |
187 | </varlistentry> | |
188 | ||
189 | <varlistentry> | |
190 | <term><constant>GL_TRANSFORM_FEEDBACK_BUFFER_MODE</constant></term> | |
191 | <listitem> | |
192 | <para> | |
193 | </para> | |
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> | |
198 | </listitem> | |
199 | </varlistentry> | |
200 | ||
201 | <varlistentry> | |
202 | <term><constant>GL_TRANSFORM_FEEDBACK_VARYINGS</constant></term> | |
203 | <listitem> | |
204 | <para> | |
205 | </para> | |
206 | <para> <parameter>params</parameter> returns the number of varying | |
207 | variables to capture in transform feedback mode for the program.</para> | |
208 | </listitem> | |
209 | </varlistentry> | |
210 | ||
211 | <varlistentry> | |
212 | <term><constant>GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH</constant></term> | |
213 | <listitem> | |
214 | <para> | |
215 | </para> | |
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> | |
218 | </listitem> | |
219 | </varlistentry> | |
220 | ||
221 | <varlistentry> | |
222 | <term><constant>GL_GEOMETRY_VERTICES_OUT</constant></term> | |
223 | <listitem> | |
224 | <para> | |
225 | </para> | |
226 | <para> <parameter>params</parameter> returns the maximum number of vertices | |
227 | that the geometry shader in <parameter>program</parameter> will output.</para> | |
228 | </listitem> | |
229 | </varlistentry> | |
230 | ||
231 | <varlistentry> | |
232 | <term><constant>GL_GEOMETRY_INPUT_TYPE</constant></term> | |
233 | <listitem> | |
234 | <para> | |
235 | </para> | |
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> | |
239 | </listitem> | |
240 | </varlistentry> | |
241 | ||
242 | <varlistentry> | |
243 | <term><constant>GL_GEOMETRY_OUTPUT_TYPE</constant></term> | |
244 | <listitem> | |
245 | <para> | |
246 | </para> | |
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> | |
250 | </listitem> | |
251 | </varlistentry> | |
252 | </variablelist> | |
253 | </refsect1> | |
254 | <refsect1 id="notes"><title>Notes</title> | |
255 | <para> | |
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. | |
259 | </para> | |
260 | <para> | |
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. | |
264 | </para> | |
265 | ||
266 | <para>If an error is generated, no change is made to the | |
267 | contents of <parameter>params</parameter>.</para> | |
268 | </refsect1> | |
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> | |
273 | ||
274 | <para><constant>GL_INVALID_OPERATION</constant> | |
275 | is generated if <parameter>program</parameter> | |
276 | does not refer to a program object.</para> | |
277 | ||
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> | |
282 | ||
283 | <para><constant>GL_INVALID_ENUM</constant> | |
284 | is generated if <parameter>pname</parameter> | |
285 | is not an accepted value.</para> | |
286 | ||
287 | </refsect1> | |
288 | <refsect1 id="associatedgets"><title>Associated Gets</title> | |
289 | <para><citerefentry><refentrytitle>glGetActiveAttrib</refentrytitle></citerefentry> | |
290 | with argument <parameter>program</parameter></para> | |
291 | ||
292 | <para><citerefentry><refentrytitle>glGetActiveUniform</refentrytitle></citerefentry> | |
293 | with argument <parameter>program</parameter></para> | |
294 | ||
295 | <para><citerefentry><refentrytitle>glGetAttachedShaders</refentrytitle></citerefentry> | |
296 | with argument <parameter>program</parameter></para> | |
297 | ||
298 | <para><citerefentry><refentrytitle>glGetProgramInfoLog</refentrytitle></citerefentry> | |
299 | with argument <parameter>program</parameter></para> | |
300 | ||
301 | <para><citerefentry><refentrytitle>glIsProgram</refentrytitle></citerefentry> | |
302 | <parameter></parameter></para> | |
303 | </refsect1> | |
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> | |
311 | </refsect1> | |
312 | <refsect1 id="Copyright"><title>Copyright</title> | |
313 | <para> | |
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>. | |
319 | </para> | |
320 | </refsect1> | |
321 | </refentry> |