Commit | Line | Data |
---|---|---|
7faf1d71 AW |
1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd"> | |
3 | <!-- saved from url=(0013)about:internet --> | |
4 | <?xml-stylesheet type="text/xsl" href="mathml.xsl"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:pref="http://www.w3.org/2002/Math/preference" pref:renderer="mathplayer-dl"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><link rel="stylesheet" type="text/css" href="opengl-man.css" /><title>glGetAttribLocation - OpenGL 4 Reference Pages</title><meta name="generator" content="DocBook XSL Stylesheets V1.69.1" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="glGetAttribLocation"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glGetAttribLocation — Returns the location of an attribute variable</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">GLint <b class="fsfunc">glGetAttribLocation</b>(</code></td><td>GLuint </td><td><var class="pdparam">program</var>, </td></tr><tr><td> </td><td>const GLchar * </td><td><var class="pdparam">name</var><code>)</code>;</td></tr></table></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><em class="parameter"><code>program</code></em></span></dt><dd><p>Specifies the program object to be | |
5 | 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 | |
6 | the name of the attribute variable whose location is | |
7 | to be queried.</p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p><code class="function">glGetAttribLocation</code> queries the | |
8 | previously linked program object specified by | |
9 | <em class="parameter"><code>program</code></em> for the attribute variable | |
10 | specified by <em class="parameter"><code>name</code></em> and returns the index | |
11 | of the generic vertex attribute that is bound to that attribute | |
12 | variable. If <em class="parameter"><code>name</code></em> is a matrix attribute | |
13 | variable, the index of the first column of the matrix is | |
14 | returned. If the named attribute variable is not an active | |
15 | attribute in the specified program object or if | |
16 | <em class="parameter"><code>name</code></em> starts with the reserved prefix | |
17 | "gl_", a value of -1 is returned.</p><p>The association between an attribute variable name and a | |
18 | generic attribute index can be specified at any time by calling | |
19 | <a href="glBindAttribLocation.xml"><span class="citerefentry"><span class="refentrytitle">glBindAttribLocation</span></span></a>. | |
20 | Attribute bindings do not go into effect until | |
21 | <a href="glLinkProgram.xml"><span class="citerefentry"><span class="refentrytitle">glLinkProgram</span></span></a> | |
22 | is called. After a program object has been linked successfully, | |
23 | the index values for attribute variables remain fixed until the | |
24 | next link command occurs. The attribute values can only be | |
25 | queried after a link if the link was successful. | |
26 | <code class="function">glGetAttribLocation</code> returns the binding | |
27 | that actually went into effect the last time | |
28 | <a href="glLinkProgram.xml"><span class="citerefentry"><span class="refentrytitle">glLinkProgram</span></span></a> | |
29 | was called for the specified program object. Attribute bindings | |
30 | that have been specified since the last link operation are not | |
31 | returned by <code class="function">glGetAttribLocation</code>.</p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p><code class="constant">GL_INVALID_OPERATION</code> is generated if | |
32 | <em class="parameter"><code>program</code></em> is not a value generated by | |
33 | OpenGL.</p><p><code class="constant">GL_INVALID_OPERATION</code> is generated if | |
34 | <em class="parameter"><code>program</code></em> is not a program object.</p><p><code class="constant">GL_INVALID_OPERATION</code> is generated if | |
35 | <em class="parameter"><code>program</code></em> has not been successfully | |
36 | linked.</p></div><div class="refsect1" lang="en" xml:lang="en"><a id="associatedgets"></a><h2>Associated Gets</h2><p><a href="glGetActiveAttrib.xml"><span class="citerefentry"><span class="refentrytitle">glGetActiveAttrib</span></span></a> | |
37 | with argument <em class="parameter"><code>program</code></em> and the index of an | |
38 | active attribute</p><p><a href="glIsProgram.xml"><span class="citerefentry"><span class="refentrytitle">glIsProgram</span></span></a></p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p><a href="glBindAttribLocation.xml"><span class="citerefentry"><span class="refentrytitle">glBindAttribLocation</span></span></a>, | |
39 | <a href="glLinkProgram.xml"><span class="citerefentry"><span class="refentrytitle">glLinkProgram</span></span></a>, | |
40 | <a href="glVertexAttrib.xml"><span class="citerefentry"><span class="refentrytitle">glVertexAttrib</span></span></a>, | |
41 | <a href="glVertexAttribPointer.xml"><span class="citerefentry"><span class="refentrytitle">glVertexAttribPointer</span></span></a></p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p> | |
42 | Copyright <span class="trademark"></span>© 2003-2005 3Dlabs Inc. Ltd. | |
43 | This material may be distributed subject to the terms and conditions set forth in | |
44 | the Open Publication License, v 1.0, 8 June 1999. | |
45 | <a href="http://opencontent.org/openpub/" target="_top">http://opencontent.org/openpub/</a>. | |
46 | </p></div></div></body></html> |