forked from BSVino/docs.gl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
glGetAttribLocation.xhtml
45 lines (45 loc) · 5.04 KB
/
glGetAttribLocation.xhtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<div class="refentry"><a id="glGetAttribLocation"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glGetAttribLocation — return the location of an attribute variable</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table class="funcprototype-table" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">GLint <strong class="fsfunc">glGetAttribLocation</strong>(</code></td><td>GLuint <var class="pdparam">program</var>, </td></tr><tr><td> </td><td>const GLchar *<var class="pdparam">name</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>program</code></em></span></dt><dd><p>Specifies the program object to be
queried.</p></dd><dt><span class="term"><em class="parameter"><code>name</code></em></span></dt><dd><p>Points to a null terminated string containing
the name of the attribute variable whose location is
to be queried.</p></dd></dl></div></div><div class="refsect1"><a id="description"></a><h2>Description</h2><p><code class="function">glGetAttribLocation</code> queries the
previously linked program object specified by
<em class="parameter"><code>program</code></em> for the attribute variable
specified by <em class="parameter"><code>name</code></em> and returns the index
of the generic vertex attribute that is bound to that attribute
variable. If <em class="parameter"><code>name</code></em> is a matrix attribute
variable, the index of the first column of the matrix is
returned. If the named attribute variable is not an active
attribute in the specified program object or if
<em class="parameter"><code>name</code></em> starts with the reserved prefix
"gl_", a value of -1 is returned.</p><p>The association between an attribute variable name and a
generic attribute index can be specified at any time by calling
<a class="citerefentry" href="glBindAttribLocation"><span class="citerefentry"><span class="refentrytitle">glBindAttribLocation</span></span></a>.
Attribute bindings do not go into effect until
<a class="citerefentry" href="glLinkProgram"><span class="citerefentry"><span class="refentrytitle">glLinkProgram</span></span></a>
is called. After a program object has been linked successfully,
the index values for attribute variables remain fixed until the
next link command occurs. The attribute values can only be
queried after a link if the link was successful.
<code class="function">glGetAttribLocation</code> returns the binding
that actually went into effect the last time
<a class="citerefentry" href="glLinkProgram"><span class="citerefentry"><span class="refentrytitle">glLinkProgram</span></span></a>
was called for the specified program object. Attribute bindings
that have been specified since the last link operation are not
returned by <code class="function">glGetAttribLocation</code>.</p></div><div class="refsect1"><a id="errors"></a><h2>Errors</h2><p><code class="constant">GL_INVALID_OPERATION</code> is generated if
<em class="parameter"><code>program</code></em> is not a value generated by
OpenGL.</p><p><code class="constant">GL_INVALID_OPERATION</code> is generated if
<em class="parameter"><code>program</code></em> is not a program object.</p><p><code class="constant">GL_INVALID_OPERATION</code> is generated if
<em class="parameter"><code>program</code></em> has not been successfully
linked.</p></div><div class="refsect1"><a id="associatedgets"></a><h2>Associated Gets</h2><p><a class="citerefentry" href="glGetActiveAttrib"><span class="citerefentry"><span class="refentrytitle">glGetActiveAttrib</span></span></a>
with argument <em class="parameter"><code>program</code></em> and the index of an
active attribute</p><p><a class="citerefentry" href="glIsProgram"><span class="citerefentry"><span class="refentrytitle">glIsProgram</span></span></a></p></div>
{$pipelinestall}{$examples}
<div class="refsect1"><a id="seealso"></a><h2>See Also</h2><p><a class="citerefentry" href="glBindAttribLocation"><span class="citerefentry"><span class="refentrytitle">glBindAttribLocation</span></span></a>,
<a class="citerefentry" href="glLinkProgram"><span class="citerefentry"><span class="refentrytitle">glLinkProgram</span></span></a>,
<a class="citerefentry" href="glVertexAttrib"><span class="citerefentry"><span class="refentrytitle">glVertexAttrib</span></span></a>,
<a class="citerefentry" href="glVertexAttribPointer"><span class="citerefentry"><span class="refentrytitle">glVertexAttribPointer</span></span></a></p></div><div class="refsect1"><div id="Copyright"><h2>Copyright</h2><p>
Copyright © 2003-2005 3Dlabs Inc. Ltd.
This material may be distributed subject to the terms and conditions set forth in
the Open Publication License, v 1.0, 8 June 1999.
<a class="ulink" href="https://opencontent.org/openpub/" target="_top">https://opencontent.org/openpub/</a>.
</p></div></div></div>