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="glGetVertexAttrib"> | |
5 | <refmeta> | |
6 | <refentrytitle>glGetVertexAttrib</refentrytitle> | |
7 | <manvolnum>3G</manvolnum> | |
8 | </refmeta> | |
9 | <refnamediv> | |
10 | <refdescriptor>glGetVertexAttrib</refdescriptor> | |
11 | <refname>glGetVertexAttribdv</refname> | |
12 | <refname>glGetVertexAttribfv</refname> | |
13 | <refname>glGetVertexAttribiv</refname> | |
14 | <refpurpose>Return a generic vertex attribute parameter</refpurpose> | |
15 | </refnamediv> | |
16 | <refsynopsisdiv><title>C Specification</title> | |
17 | <funcsynopsis> | |
18 | <funcprototype> | |
19 | <funcdef>void <function>glGetVertexAttribdv</function></funcdef> | |
20 | <paramdef>GLuint <parameter>index</parameter></paramdef> | |
21 | <paramdef>GLenum <parameter>pname</parameter></paramdef> | |
22 | <paramdef>GLdouble *<parameter>params</parameter></paramdef> | |
23 | </funcprototype> | |
24 | <funcprototype> | |
25 | <funcdef>void <function>glGetVertexAttribfv</function></funcdef> | |
26 | <paramdef>GLuint <parameter>index</parameter></paramdef> | |
27 | <paramdef>GLenum <parameter>pname</parameter></paramdef> | |
28 | <paramdef>GLfloat *<parameter>params</parameter></paramdef> | |
29 | </funcprototype> | |
30 | <funcprototype> | |
31 | <funcdef>void <function>glGetVertexAttribiv</function></funcdef> | |
32 | <paramdef>GLuint <parameter>index</parameter></paramdef> | |
33 | <paramdef>GLenum <parameter>pname</parameter></paramdef> | |
34 | <paramdef>GLint *<parameter>params</parameter></paramdef> | |
35 | </funcprototype> | |
36 | <funcprototype> | |
37 | <funcdef>void <function>glGetVertexAttribIiv</function></funcdef> | |
38 | <paramdef>GLuint <parameter>index</parameter></paramdef> | |
39 | <paramdef>GLenum <parameter>pname</parameter></paramdef> | |
40 | <paramdef>GLint *<parameter>params</parameter></paramdef> | |
41 | </funcprototype> | |
42 | <funcprototype> | |
43 | <funcdef>void <function>glGetVertexAttribIuiv</function></funcdef> | |
44 | <paramdef>GLuint <parameter>index</parameter></paramdef> | |
45 | <paramdef>GLenum <parameter>pname</parameter></paramdef> | |
46 | <paramdef>GLuint *<parameter>params</parameter></paramdef> | |
47 | </funcprototype> | |
48 | </funcsynopsis> | |
49 | </refsynopsisdiv> | |
50 | <refsect1 id="parameters"><title>Parameters</title> | |
51 | <variablelist> | |
52 | <varlistentry> | |
53 | <term><parameter>index</parameter></term> | |
54 | <listitem> | |
55 | <para>Specifies the generic vertex attribute | |
56 | parameter to be queried.</para> | |
57 | </listitem> | |
58 | </varlistentry> | |
59 | <varlistentry> | |
60 | <term><parameter>pname</parameter></term> | |
61 | <listitem> | |
62 | <para>Specifies the symbolic name of the vertex | |
63 | attribute parameter to be queried. Accepted values are | |
64 | <constant>GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING</constant>, | |
65 | <constant>GL_VERTEX_ATTRIB_ARRAY_ENABLED</constant>, | |
66 | <constant>GL_VERTEX_ATTRIB_ARRAY_SIZE</constant>, | |
67 | <constant>GL_VERTEX_ATTRIB_ARRAY_STRIDE</constant>, | |
68 | <constant>GL_VERTEX_ATTRIB_ARRAY_TYPE</constant>, | |
69 | <constant>GL_VERTEX_ATTRIB_ARRAY_NORMALIZED</constant>, | |
70 | <constant>GL_VERTEX_ATTRIB_ARRAY_INTEGER</constant>, | |
71 | <constant>GL_VERTEX_ATTRIB_ARRAY_DIVISOR</constant>, or | |
72 | <constant>GL_CURRENT_VERTEX_ATTRIB</constant>.</para> | |
73 | </listitem> | |
74 | </varlistentry> | |
75 | <varlistentry> | |
76 | <term><parameter>params</parameter></term> | |
77 | <listitem> | |
78 | <para>Returns the requested data.</para> | |
79 | </listitem> | |
80 | </varlistentry> | |
81 | </variablelist> | |
82 | </refsect1> | |
83 | <refsect1 id="description"><title>Description</title> | |
84 | <para><function>glGetVertexAttrib</function> returns in | |
85 | <parameter>params</parameter> the value of a generic vertex | |
86 | attribute parameter. The generic vertex attribute to be queried | |
87 | is specified by <parameter>index</parameter>, and the parameter | |
88 | to be queried is specified by <parameter>pname</parameter>.</para> | |
89 | ||
90 | <para>The accepted parameter names are as follows:</para> | |
91 | ||
92 | <variablelist> | |
93 | <varlistentry> | |
94 | <term><constant>GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING</constant></term> | |
95 | <listitem> | |
96 | <para> | |
97 | </para> | |
98 | <para> <parameter>params</parameter> returns a | |
99 | single value, the name of the buffer object currently bound to | |
100 | the binding point corresponding to generic vertex attribute array | |
101 | <parameter>index</parameter>. If no buffer object is bound, | |
102 | 0 is returned. The initial value is 0.</para> | |
103 | </listitem> | |
104 | </varlistentry> | |
105 | ||
106 | <varlistentry> | |
107 | <term><constant>GL_VERTEX_ATTRIB_ARRAY_ENABLED</constant></term> | |
108 | <listitem> | |
109 | <para> | |
110 | </para> | |
111 | <para> <parameter>params</parameter> returns a | |
112 | single value that is non-zero (true) if the vertex | |
113 | attribute array for <parameter>index</parameter> is | |
114 | enabled and 0 (false) if it is disabled. The initial | |
115 | value is <constant>GL_FALSE</constant>.</para> | |
116 | </listitem> | |
117 | </varlistentry> | |
118 | ||
119 | <varlistentry> | |
120 | <term><constant>GL_VERTEX_ATTRIB_ARRAY_SIZE</constant></term> | |
121 | <listitem> | |
122 | <para> | |
123 | </para> | |
124 | <para> <parameter>params</parameter> returns a | |
125 | single value, the size of the vertex attribute array | |
126 | for <parameter>index</parameter>. The size is the | |
127 | number of values for each element of the vertex | |
128 | attribute array, and it will be 1, 2, 3, or 4. The | |
129 | initial value is 4.</para> | |
130 | </listitem> | |
131 | </varlistentry> | |
132 | ||
133 | <varlistentry> | |
134 | <term><constant>GL_VERTEX_ATTRIB_ARRAY_STRIDE</constant></term> | |
135 | <listitem> | |
136 | <para> | |
137 | </para> | |
138 | <para> <parameter>params</parameter> returns a | |
139 | single value, the array stride for (number of bytes | |
140 | between successive elements in) the vertex attribute | |
141 | array for <parameter>index</parameter>. A value of 0 | |
142 | indicates that the array elements are stored | |
143 | sequentially in memory. The initial value is 0.</para> | |
144 | </listitem> | |
145 | </varlistentry> | |
146 | ||
147 | <varlistentry> | |
148 | <term><constant>GL_VERTEX_ATTRIB_ARRAY_TYPE</constant></term> | |
149 | <listitem> | |
150 | <para> | |
151 | </para> | |
152 | <para> <parameter>params</parameter> returns a | |
153 | single value, a symbolic constant indicating the | |
154 | array type for the vertex attribute array for | |
155 | <parameter>index</parameter>. Possible values are | |
156 | <constant>GL_BYTE</constant>, | |
157 | <constant>GL_UNSIGNED_BYTE</constant>, | |
158 | <constant>GL_SHORT</constant>, | |
159 | <constant>GL_UNSIGNED_SHORT</constant>, | |
160 | <constant>GL_INT</constant>, | |
161 | <constant>GL_UNSIGNED_INT</constant>, | |
162 | <constant>GL_FLOAT</constant>, and | |
163 | <constant>GL_DOUBLE</constant>. The initial value is | |
164 | <constant>GL_FLOAT</constant>.</para> | |
165 | </listitem> | |
166 | </varlistentry> | |
167 | ||
168 | <varlistentry> | |
169 | <term><constant>GL_VERTEX_ATTRIB_ARRAY_NORMALIZED</constant></term> | |
170 | <listitem> | |
171 | <para> | |
172 | </para> | |
173 | <para> <parameter>params</parameter> returns a | |
174 | single value that is non-zero (true) if fixed-point | |
175 | data types for the vertex attribute array indicated | |
176 | by <parameter>index</parameter> are normalized when | |
177 | they are converted to floating point, and 0 (false) | |
178 | otherwise. The initial value is | |
179 | <constant>GL_FALSE</constant>.</para> | |
180 | </listitem> | |
181 | </varlistentry> | |
182 | ||
183 | <varlistentry> | |
184 | <term><constant>GL_VERTEX_ATTRIB_ARRAY_INTEGER</constant></term> | |
185 | <listitem> | |
186 | <para> | |
187 | </para> | |
188 | <para> <parameter>params</parameter> returns a | |
189 | single value that is non-zero (true) if fixed-point | |
190 | data types for the vertex attribute array indicated | |
191 | by <parameter>index</parameter> have integer data types, and 0 (false) | |
192 | otherwise. The initial value is | |
193 | 0 (<constant>GL_FALSE</constant>).</para> | |
194 | </listitem> | |
195 | </varlistentry> | |
196 | ||
197 | <varlistentry> | |
198 | <term><constant>GL_VERTEX_ATTRIB_ARRAY_DIVISOR</constant></term> | |
199 | <listitem> | |
200 | <para> | |
201 | </para> | |
202 | <para> <parameter>params</parameter> returns a | |
203 | single value that is the frequency divisor used for instanced | |
204 | rendering. See <citerefentry><refentrytitle>glVertexAttribDivisor</refentrytitle></citerefentry>. | |
205 | The initial value is 0.</para> | |
206 | </listitem> | |
207 | </varlistentry> | |
208 | ||
209 | <varlistentry> | |
210 | <term><constant>GL_CURRENT_VERTEX_ATTRIB</constant></term> | |
211 | <listitem> | |
212 | <para> | |
213 | </para> | |
214 | <para> <parameter>params</parameter> returns four | |
215 | values that represent the current value for the | |
216 | generic vertex attribute specified by index. Generic | |
217 | vertex attribute 0 is unique in that it has no | |
218 | current state, so an error will be generated if | |
219 | <parameter>index</parameter> is 0. The initial value | |
220 | for all other generic vertex attributes is | |
221 | (0,0,0,1).</para> | |
222 | </listitem> | |
223 | </varlistentry> | |
224 | </variablelist> | |
225 | ||
226 | <para>All of the parameters except <constant>GL_CURRENT_VERTEX_ATTRIB</constant> | |
227 | represent state stored in the currently bound vertex array object.</para> | |
228 | ||
229 | </refsect1> | |
230 | <refsect1 id="notes"><title>Notes</title> | |
231 | <para>If an error is generated, no change is made to the | |
232 | contents of <parameter>params</parameter>.</para> | |
233 | </refsect1> | |
234 | <refsect1 id="errors"><title>Errors</title> | |
235 | <para><constant>GL_INVALID_OPERATION</constant> is generated if <parameter>pname</parameter> | |
236 | is not <constant>GL_CURRENT_VERTEX_ATTRIB</constant> and there is no | |
237 | currently bound vertex array object.</para> | |
238 | ||
239 | <para><constant>GL_INVALID_VALUE</constant> is generated if | |
240 | <parameter>index</parameter> is greater than or equal to | |
241 | <constant>GL_MAX_VERTEX_ATTRIBS</constant>.</para> | |
242 | ||
243 | <para><constant>GL_INVALID_ENUM</constant> is generated if | |
244 | <parameter>pname</parameter> is not an accepted value.</para> | |
245 | ||
246 | <para><constant>GL_INVALID_OPERATION</constant> is generated if | |
247 | <parameter>index</parameter> is 0 and | |
248 | <parameter>pname</parameter> is | |
249 | <constant>GL_CURRENT_VERTEX_ATTRIB</constant>.</para> | |
250 | </refsect1> | |
251 | <refsect1 id="associatedgets"><title>Associated Gets</title> | |
252 | <para><citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> | |
253 | with argument <constant>GL_MAX_VERTEX_ATTRIBS</constant></para> | |
254 | ||
255 | <para><citerefentry><refentrytitle>glGetVertexAttribPointerv</refentrytitle></citerefentry> | |
256 | with arguments <parameter>index</parameter> and | |
257 | <constant>GL_VERTEX_ATTRIB_ARRAY_POINTER</constant></para> | |
258 | </refsect1> | |
259 | <refsect1 id="seealso"><title>See Also</title> | |
260 | <para><citerefentry><refentrytitle>glBindAttribLocation</refentrytitle></citerefentry>, | |
261 | <citerefentry><refentrytitle>glBindBuffer</refentrytitle></citerefentry>, | |
262 | <citerefentry><refentrytitle>glDisableVertexAttribArray</refentrytitle></citerefentry>, | |
263 | <citerefentry><refentrytitle>glEnableVertexAttribArray</refentrytitle></citerefentry>, | |
264 | <citerefentry><refentrytitle>glVertexAttrib</refentrytitle></citerefentry>, | |
265 | <citerefentry><refentrytitle>glVertexAttribDivisor</refentrytitle></citerefentry>, | |
266 | <citerefentry><refentrytitle>glVertexAttribPointer</refentrytitle></citerefentry></para> | |
267 | </refsect1> | |
268 | <refsect1 id="Copyright"><title>Copyright</title> | |
269 | <para> | |
270 | Copyright <trademark class="copyright"></trademark> 2003-2005 3Dlabs Inc. Ltd. | |
271 | Copyright <trademark class="copyright"></trademark> 2010 Khronos Group. | |
272 | This material may be distributed subject to the terms and conditions set forth in | |
273 | the Open Publication License, v 1.0, 8 June 1999. | |
274 | <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>. | |
275 | </para> | |
276 | </refsect1> | |
277 | </refentry> |