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_MAX_LENGTH</constant>.</para> | |
46 | </listitem> | |
47 | </varlistentry> | |
48 | <varlistentry> | |
49 | <term><parameter>params</parameter></term> | |
50 | <listitem> | |
51 | <para>Returns the requested object parameter.</para> | |
52 | </listitem> | |
53 | </varlistentry> | |
54 | </variablelist> | |
55 | </refsect1> | |
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> | |
60 | ||
61 | <variablelist> | |
62 | <varlistentry> | |
63 | <term><constant>GL_DELETE_STATUS</constant></term> | |
64 | <listitem> | |
65 | <para> | |
66 | </para> | |
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> | |
71 | otherwise.</para> | |
72 | </listitem> | |
73 | </varlistentry> | |
74 | ||
75 | <varlistentry> | |
76 | <term><constant>GL_LINK_STATUS</constant></term> | |
77 | <listitem> | |
78 | <para> | |
79 | </para> | |
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> | |
84 | otherwise.</para> | |
85 | </listitem> | |
86 | </varlistentry> | |
87 | ||
88 | <varlistentry> | |
89 | <term><constant>GL_VALIDATE_STATUS</constant></term> | |
90 | <listitem> | |
91 | <para> | |
92 | </para> | |
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> | |
98 | otherwise.</para> | |
99 | </listitem> | |
100 | </varlistentry> | |
101 | ||
102 | <varlistentry> | |
103 | <term><constant>GL_INFO_LOG_LENGTH</constant></term> | |
104 | <listitem> | |
105 | <para> | |
106 | </para> | |
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 | |
114 | returned.</para> | |
115 | </listitem> | |
116 | </varlistentry> | |
117 | ||
118 | <varlistentry> | |
119 | <term><constant>GL_ATTACHED_SHADERS</constant></term> | |
120 | <listitem> | |
121 | <para> | |
122 | </para> | |
123 | <para> <parameter>params</parameter> returns the | |
124 | number of shader objects attached to | |
125 | <parameter>program</parameter>.</para> | |
126 | </listitem> | |
127 | </varlistentry> | |
128 | ||
129 | <varlistentry> | |
130 | <term><constant>GL_ACTIVE_ATTRIBUTES</constant></term> | |
131 | <listitem> | |
132 | <para> | |
133 | </para> | |
134 | <para> <parameter>params</parameter> returns the | |
135 | number of active attribute variables for | |
136 | <parameter>program</parameter>.</para> | |
137 | </listitem> | |
138 | </varlistentry> | |
139 | ||
140 | <varlistentry> | |
141 | <term><constant>GL_ACTIVE_ATTRIBUTE_MAX_LENGTH</constant></term> | |
142 | <listitem> | |
143 | <para> | |
144 | </para> | |
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 | |
151 | returned.</para> | |
152 | </listitem> | |
153 | </varlistentry> | |
154 | ||
155 | <varlistentry> | |
156 | <term><constant>GL_ACTIVE_UNIFORMS</constant></term> | |
157 | <listitem> | |
158 | <para> | |
159 | </para> | |
160 | <para> <parameter>params</parameter> returns the | |
161 | number of active uniform variables for | |
162 | <parameter>program</parameter>.</para> | |
163 | </listitem> | |
164 | </varlistentry> | |
165 | ||
166 | <varlistentry> | |
167 | <term><constant>GL_ACTIVE_UNIFORM_MAX_LENGTH</constant></term> | |
168 | <listitem> | |
169 | <para> | |
170 | </para> | |
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> | |
178 | </listitem> | |
179 | </varlistentry> | |
180 | </variablelist> | |
181 | </refsect1> | |
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> | |
185 | ||
186 | <para>If an error is generated, no change is made to the | |
187 | contents of <parameter>params</parameter>.</para> | |
188 | </refsect1> | |
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> | |
193 | ||
194 | <para><constant>GL_INVALID_OPERATION</constant> | |
195 | is generated if <parameter>program</parameter> | |
196 | does not refer to a program object.</para> | |
197 | ||
198 | <para><constant>GL_INVALID_ENUM</constant> | |
199 | is generated if <parameter>pname</parameter> | |
200 | is not an accepted value.</para> | |
201 | ||
202 | <para><constant>GL_INVALID_OPERATION</constant> is generated if | |
203 | <function>glGetProgram</function> is executed between the | |
204 | execution of | |
205 | <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry> | |
206 | and the corresponding execution of | |
207 | <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.</para> | |
208 | </refsect1> | |
209 | <refsect1 id="associatedgets"><title>Associated Gets</title> | |
210 | <para><citerefentry><refentrytitle>glGetActiveAttrib</refentrytitle></citerefentry> | |
211 | with argument <parameter>program</parameter></para> | |
212 | ||
213 | <para><citerefentry><refentrytitle>glGetActiveUniform</refentrytitle></citerefentry> | |
214 | with argument <parameter>program</parameter></para> | |
215 | ||
216 | <para><citerefentry><refentrytitle>glGetAttachedShaders</refentrytitle></citerefentry> | |
217 | with argument <parameter>program</parameter></para> | |
218 | ||
219 | <para><citerefentry><refentrytitle>glGetProgramInfoLog</refentrytitle></citerefentry> | |
220 | with argument <parameter>program</parameter></para> | |
221 | ||
222 | <para><citerefentry><refentrytitle>glIsProgram</refentrytitle></citerefentry> | |
223 | <parameter></parameter></para> | |
224 | </refsect1> | |
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> | |
232 | </refsect1> | |
233 | <refsect1 id="Copyright"><title>Copyright</title> | |
234 | <para> | |
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>. | |
239 | </para> | |
240 | </refsect1> | |
241 | </refentry> |