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