rename upstream-man-pages to upstream-doc
[clinton/guile-figl.git] / upstream-doc / man4 / glGetProgramResourceLocation.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="glGetProgramResourceLocation">\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>glGetProgramResourceLocation</refentrytitle>\r
13 <manvolnum>3G</manvolnum>\r
14 </refmeta>\r
15 <refnamediv>\r
16 <refname>glGetProgramResourceLocation</refname>\r
17 <refpurpose>query the location of a named resource 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>glGetProgramResourceLocation</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 location 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>GL_UNIFORM</constant>, <constant>GL_PROGRAM_INPUT</constant>, <constant>GL_PROGRAM_OUTPUT</constant>,\r
64 <constant>GL_VERTEX_SUBROUTINE_UNIFORM</constant>, <constant>GL_TESS_CONTROL_SUBROUTINE_UNIFORM</constant>,\r
65 <constant>GL_TESS_EVALUATION_SUBROUTINE_UNIFORM</constant>, <constant>GL_GEOMETRY_SUBROUTINE_UNIFORM</constant>,\r
66 <constant>GL_FRAGMENT_SUBROUTINE_UNIFORM</constant>, or <constant>GL_COMPUTE_SUBROUTINE_UNIFORM</constant>.\r
67 The value -1 will be returned if an error occurs, if <parameter>name</parameter> does not identify an active variable on\r
68 <parameter>programInterface</parameter>, or if <parameter>name</parameter> identifies an active variable that does\r
69 not have a valid location assigned, as described above. The locations\r
70 returned by these commands are the same locations returned when querying\r
71 the <constant>GL_LOCATION</constant> and <constant>GL_LOCATION_INDEX</constant> resource properties.\r
72 </para>\r
73 <para>\r
74 A string provided to <function>glGetProgramResourceLocation</function> is considered to match an active variable if:\r
75 </para>\r
76 <itemizedlist>\r
77 <listitem>\r
78 <para>\r
79 the string exactly matches the name of the active variable\r
80 </para>\r
81 </listitem>\r
82 <listitem>\r
83 <para>\r
84 if the string identifies the base name of an active array, where the\r
85 string would exactly match the name of the variable if the suffix\r
86 "[0]" were appended to the string\r
87 </para>\r
88 </listitem>\r
89 <listitem>\r
90 <para>\r
91 if the string identifies an active element of the array, where the\r
92 string ends with the concatenation of the "[" character, an integer\r
93 <emphasis>with no "+" sign, extra leading zeroes, or whitespace</emphasis> identifying an\r
94 array element, and the "]" character, the integer is less than the\r
95 number of active elements of the array variable, and where the string\r
96 would exactly match the enumerated name of the array if the decimal\r
97 integer were replaced with zero.\r
98 </para>\r
99 </listitem>\r
100 </itemizedlist>\r
101 <para>\r
102 Any other string is considered not to identify an active variable. If the\r
103 string specifies an element of an array variable,\r
104 <function>glGetProgramResourceLocation</function> returns the\r
105 location assigned to that element. If it\r
106 specifies the base name of an array, it identifies the resources\r
107 associated with the first element of the array.\r
108 </para>\r
109 </refsect1>\r
110 <refsect1 id="errors"><title>Errors</title>\r
111 <para>\r
112 <constant>GL_INVALID_VALUE</constant> is generated if <parameter>program</parameter>\r
113 is not the name of an existing program object.\r
114 </para>\r
115 <para>\r
116 <constant>GL_INVALID_ENUM</constant> is generated if <parameter>programInterface</parameter>\r
117 is not one of the accepted interface types.\r
118 </para>\r
119 <para>\r
120 <constant>GL_INVALID_OPERATION</constant> is generated if <parameter>program</parameter>\r
121 has not been linked successfully.\r
122 </para>\r
123 </refsect1>\r
124 <refsect1 id="seealso"><title>See Also</title>\r
125 <para>\r
126 <citerefentry><refentrytitle>glGetProgramResourceName</refentrytitle></citerefentry>,\r
127 <citerefentry><refentrytitle>glGetProgramResourceIndex</refentrytitle></citerefentry>,\r
128 <citerefentry><refentrytitle>glGetGetProgramResource</refentrytitle></citerefentry>,\r
129 <citerefentry><refentrytitle>glGetProgramResourceLocationIndex</refentrytitle></citerefentry>.\r
130 </para>\r
131 </refsect1>\r
132 <refsect1 id="Copyright"><title>Copyright</title>\r
133 <para>\r
134 Copyright <trademark class="copyright"></trademark> 2012 Khronos Group. \r
135 This material may be distributed subject to the terms and conditions set forth in \r
136 the Open Publication License, v 1.0, 8 June 1999.\r
137 <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.\r
138 </para>\r
139 </refsect1>\r
140</refentry>\r