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