rename upstream-man-pages to upstream-doc
[clinton/guile-figl.git] / upstream-doc / man2 / glGetAttribLocation.xml
CommitLineData
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="glGetAttribLocation">
5 <refmeta>
6 <refentrytitle>glGetAttribLocation</refentrytitle>
7 <manvolnum>3G</manvolnum>
8 </refmeta>
9 <refnamediv>
10 <refname>glGetAttribLocation</refname>
11 <refpurpose>Returns the location of an attribute variable</refpurpose>
12 </refnamediv>
13 <refsynopsisdiv><title>C Specification</title>
14 <funcsynopsis>
15 <funcprototype>
16 <funcdef>GLint <function>glGetAttribLocation</function></funcdef>
17 <paramdef>GLuint <parameter>program</parameter></paramdef>
18 <paramdef>const GLchar *<parameter>name</parameter></paramdef>
19 </funcprototype>
20 </funcsynopsis>
21 </refsynopsisdiv>
22 <refsect1 id="parameters"><title>Parameters</title>
23 <variablelist>
24 <varlistentry>
25 <term><parameter>program</parameter></term>
26 <listitem>
27 <para>Specifies the program object to be
28 queried.</para>
29 </listitem>
30 </varlistentry>
31 <varlistentry>
32 <term><parameter>name</parameter></term>
33 <listitem>
34 <para>Points to a null terminated string containing
35 the name of the attribute variable whose location is
36 to be queried.</para>
37 </listitem>
38 </varlistentry>
39 </variablelist>
40 </refsect1>
41 <refsect1 id="description"><title>Description</title>
42 <para><function>glGetAttribLocation</function> queries the
43 previously linked program object specified by
44 <parameter>program</parameter> for the attribute variable
45 specified by <parameter>name</parameter> and returns the index
46 of the generic vertex attribute that is bound to that attribute
47 variable. If <parameter>name</parameter> is a matrix attribute
48 variable, the index of the first column of the matrix is
49 returned. If the named attribute variable is not an active
50 attribute in the specified program object or if
51 <parameter>name</parameter> starts with the reserved prefix
52 &quot;gl_&quot;, a value of -1 is returned.</para>
53
54 <para>The association between an attribute variable name and a
55 generic attribute index can be specified at any time by calling
56 <citerefentry><refentrytitle>glBindAttribLocation</refentrytitle></citerefentry>.
57 Attribute bindings do not go into effect until
58 <citerefentry><refentrytitle>glLinkProgram</refentrytitle></citerefentry>
59 is called. After a program object has been linked successfully,
60 the index values for attribute variables remain fixed until the
61 next link command occurs. The attribute values can only be
62 queried after a link if the link was successful.
63 <function>glGetAttribLocation</function> returns the binding
64 that actually went into effect the last time
65 <citerefentry><refentrytitle>glLinkProgram</refentrytitle></citerefentry>
66 was called for the specified program object. Attribute bindings
67 that have been specified since the last link operation are not
68 returned by <function>glGetAttribLocation</function>.</para>
69 </refsect1>
70 <refsect1 id="notes"><title>Notes</title>
71 <para><function>glGetAttribLocation</function> is available only
72 if the GL version is 2.0 or greater.</para>
73 </refsect1>
74 <refsect1 id="errors"><title>Errors</title>
75 <para><constant>GL_INVALID_OPERATION</constant> is generated if
76 <parameter>program</parameter> is not a value generated by
77 OpenGL.</para>
78
79 <para><constant>GL_INVALID_OPERATION</constant> is generated if
80 <parameter>program</parameter> is not a program object.</para>
81
82 <para><constant>GL_INVALID_OPERATION</constant> is generated if
83 <parameter>program</parameter> has not been successfully
84 linked.</para>
85
86 <para><constant>GL_INVALID_OPERATION</constant> is generated if
87 <function>glGetAttribLocation</function> is executed between the
88 execution of
89 <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>
90 and the corresponding execution of
91 <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.</para>
92 </refsect1>
93 <refsect1 id="associatedgets"><title>Associated Gets</title>
94 <para><citerefentry><refentrytitle>glGetActiveAttrib</refentrytitle></citerefentry>
95 with argument <parameter>program</parameter> and the index of an
96 active attribute</para>
97
98 <para><citerefentry><refentrytitle>glIsProgram</refentrytitle></citerefentry></para>
99 </refsect1>
100 <refsect1 id="seealso"><title>See Also</title>
101 <para><citerefentry><refentrytitle>glBindAttribLocation</refentrytitle></citerefentry>,
102 <citerefentry><refentrytitle>glLinkProgram</refentrytitle></citerefentry>,
103 <citerefentry><refentrytitle>glVertexAttrib</refentrytitle></citerefentry>,
104 <citerefentry><refentrytitle>glVertexAttribPointer</refentrytitle></citerefentry></para>
105 </refsect1>
106 <refsect1 id="Copyright"><title>Copyright</title>
107 <para>
108 Copyright <trademark class="copyright"></trademark> 2003-2005 3Dlabs Inc. Ltd.
109 This material may be distributed subject to the terms and conditions set forth in
110 the Open Publication License, v 1.0, 8 June 1999.
111 <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
112 </para>
113 </refsect1>
114</refentry>