rename upstream-man-pages to upstream-doc
[clinton/guile-figl.git] / upstream-doc / man4 / glGetProgramResourceLocationIndex.xml
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="glGetProgramResourceLocationIndex">
5 <refmeta>
6 <refmetainfo>
7 <copyright>
8 <year>2012</year>
9 <holder>Khronos Group</holder>
10 </copyright>
11 </refmetainfo>
12 <refentrytitle>glGetProgramResourceLocationIndex</refentrytitle>
13 <manvolnum>3G</manvolnum>
14 </refmeta>
15 <refnamediv>
16 <refname>glGetProgramResourceLocationIndex</refname>
17 <refpurpose>query the fragment color index of a named variable within a program</refpurpose>
18 </refnamediv>
19 <refsynopsisdiv><title>C Specification</title>
20 <funcsynopsis>
21 <funcprototype>
22 <funcdef>GLint <function>glGetProgramResourceLocationIndex</function></funcdef>
23 <paramdef>GLuint <parameter>program</parameter></paramdef>
24 <paramdef>GLenum <parameter>programInterface</parameter></paramdef>
25 <paramdef>const char * <parameter>name</parameter></paramdef>
26 </funcprototype>
27 </funcsynopsis>
28 </refsynopsisdiv>
29 <refsect1 id="parameters"><title>Parameters</title>
30 <variablelist>
31 <varlistentry>
32 <term><parameter>program</parameter></term>
33 <listitem>
34 <para>
35 The name of a program object whose resources to query.
36 </para>
37 </listitem>
38 </varlistentry>
39 <varlistentry>
40 <term><parameter>programInterface</parameter></term>
41 <listitem>
42 <para>
43 A token identifying the interface within <parameter>program</parameter> containing the resource named <parameter>name</parameter>.
44 </para>
45 </listitem>
46 </varlistentry>
47 <varlistentry>
48 <term><parameter>name</parameter></term>
49 <listitem>
50 <para>
51 The name of the resource to query the location of.
52 </para>
53 </listitem>
54 </varlistentry>
55 </variablelist>
56 </refsect1>
57 <refsect1 id="description"><title>Description</title>
58 <para>
59 <function>glGetProgramResourceLocation</function> returns the fragment color index assigned
60 to the variable named <parameter>name</parameter> in interface <parameter>programInterface</parameter> of program
61 object <parameter>program</parameter>. <parameter>program</parameter> must be the name of a program that has been
62 linked successfully. <parameter>programInterface</parameter> must
63 be one of <constant>PROGRAM_OUTPUT</constant>.
64 The value -1 will be returned if an error occurs, if <parameter>name</parameter> does not identify an active variable on
65 <parameter>programInterface</parameter>, or if <parameter>name</parameter> identifies an active variable that does
66 not have a valid location assigned, as described above. The locations
67 returned by these commands are the same locations returned when querying
68 the <constant>GL_LOCATION</constant> and <constant>GL_LOCATION_INDEX</constant> resource properties.
69 </para>
70 <para>
71 A string provided to <function>glGetProgramResourceLocationIndex</function> is considered to match an active variable if:
72 </para>
73 <itemizedlist>
74 <listitem>
75 <para>
76 the string exactly matches the name of the active variable
77 </para>
78 </listitem>
79 <listitem>
80 <para>
81 if the string identifies the base name of an active array, where the
82 string would exactly match the name of the variable if the suffix
83 "[0]" were appended to the string
84 </para>
85 </listitem>
86 <listitem>
87 <para>
88 if the string identifies an active element of the array, where the
89 string ends with the concatenation of the "[" character, an integer
90 <emphasis>with no "+" sign, extra leading zeroes, or whitespace</emphasis> identifying an
91 array element, and the "]" character, the integer is less than the
92 number of active elements of the array variable, and where the string
93 would exactly match the enumerated name of the array if the decimal
94 integer were replaced with zero.
95 </para>
96 </listitem>
97 </itemizedlist>
98 <para>
99 Any other string is considered not to identify an active variable. If the
100 string specifies an element of an array variable,
101 <function>glGetProgramResourceLocation</function> returns the
102 location assigned to that element. If it
103 specifies the base name of an array, it identifies the resources
104 associated with the first element of the array.
105 </para>
106 </refsect1>
107 <refsect1 id="errors"><title>Errors</title>
108 <para>
109 <constant>GL_INVALID_VALUE</constant> is generated if <parameter>program</parameter>
110 is not the name of an existing program object.
111 </para>
112 <para>
113 <constant>GL_INVALID_ENUM</constant> is generated if <parameter>programInterface</parameter>
114 is not one of the accepted interface types.
115 </para>
116 <para>
117 <constant>GL_INVALID_OPERATION</constant> is generated if <parameter>program</parameter>
118 has not been linked successfully.
119 </para>
120 </refsect1>
121 <refsect1 id="seealso"><title>See Also</title>
122 <para>
123 <citerefentry><refentrytitle>glGetProgramResourceName</refentrytitle></citerefentry>,
124 <citerefentry><refentrytitle>glGetProgramResourceIndex</refentrytitle></citerefentry>,
125 <citerefentry><refentrytitle>glGetGetProgramResource</refentrytitle></citerefentry>,
126 <citerefentry><refentrytitle>glGetProgramResourceLocationIndex</refentrytitle></citerefentry>.
127 </para>
128 </refsect1>
129 <refsect1 id="Copyright"><title>Copyright</title>
130 <para>
131 Copyright <trademark class="copyright"></trademark> 2012 Khronos Group.
132 This material may be distributed subject to the terms and conditions set forth in
133 the Open Publication License, v 1.0, 8 June 1999.
134 <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
135 </para>
136 </refsect1>
137 </refentry>