aa3deb603ae2282de62a24e927c8a4a35a0f286c
[clinton/guile-figl.git] / upstream-man-pages / man4 / xhtml / glGetProgramResourceLocationIndex.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd">
3 <!-- saved from url=(0013)about:internet -->
4 <?xml-stylesheet type="text/xsl" href="mathml.xsl"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:pref="http://www.w3.org/2002/Math/preference" pref:renderer="mathplayer-dl"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><link rel="stylesheet" type="text/css" href="opengl-man.css" /><title>glGetProgramResourceLocationIndex - OpenGL 4 Reference Pages</title><meta name="generator" content="DocBook XSL Stylesheets V1.69.1" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="glGetProgramResourceLocationIndex"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glGetProgramResourceLocationIndex — query the fragment color index of a named variable within a program</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">GLint <b class="fsfunc">glGetProgramResourceLocationIndex</b>(</code></td><td>GLuint  </td><td><var class="pdparam">program</var>, </td></tr><tr><td> </td><td>GLenum  </td><td><var class="pdparam">programInterface</var>, </td></tr><tr><td> </td><td>const char *  </td><td><var class="pdparam">name</var><code>)</code>;</td></tr></table></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><em class="parameter"><code>program</code></em></span></dt><dd><p>
5 The name of a program object whose resources to query.
6 </p></dd><dt><span class="term"><em class="parameter"><code>programInterface</code></em></span></dt><dd><p>
7 A token identifying the interface within <em class="parameter"><code>program</code></em> containing the resource named <em class="parameter"><code>name</code></em>.
8 </p></dd><dt><span class="term"><em class="parameter"><code>name</code></em></span></dt><dd><p>
9 The name of the resource to query the location of.
10 </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p>
11 <code class="function">glGetProgramResourceLocation</code> returns the fragment color index assigned
12 to the variable named <em class="parameter"><code>name</code></em> in interface <em class="parameter"><code>programInterface</code></em> of program
13 object <em class="parameter"><code>program</code></em>. <em class="parameter"><code>program</code></em> must be the name of a program that has been
14 linked successfully. <em class="parameter"><code>programInterface</code></em> must
15 be one of <code class="constant">PROGRAM_OUTPUT</code>.
16 The value -1 will be returned if an error occurs, if <em class="parameter"><code>name</code></em> does not identify an active variable on
17 <em class="parameter"><code>programInterface</code></em>, or if <em class="parameter"><code>name</code></em> identifies an active variable that does
18 not have a valid location assigned, as described above. The locations
19 returned by these commands are the same locations returned when querying
20 the <code class="constant">GL_LOCATION</code> and <code class="constant">GL_LOCATION_INDEX</code> resource properties.
21 </p><p>
22 A string provided to <code class="function">glGetProgramResourceLocationIndex</code> is considered to match an active variable if:
23 </p><div class="itemizedlist"><ul type="disc"><li><p>
24 the string exactly matches the name of the active variable
25 </p></li><li><p>
26 if the string identifies the base name of an active array, where the
27 string would exactly match the name of the variable if the suffix
28 "[0]" were appended to the string
29 </p></li><li><p>
30 if the string identifies an active element of the array, where the
31 string ends with the concatenation of the "[" character, an integer
32 <span class="emphasis"><em>with no "+" sign, extra leading zeroes, or whitespace</em></span> identifying an
33 array element, and the "]" character, the integer is less than the
34 number of active elements of the array variable, and where the string
35 would exactly match the enumerated name of the array if the decimal
36 integer were replaced with zero.
37 </p></li></ul></div><p>
38 Any other string is considered not to identify an active variable. If the
39 string specifies an element of an array variable,
40 <code class="function">glGetProgramResourceLocation</code> returns the
41 location assigned to that element. If it
42 specifies the base name of an array, it identifies the resources
43 associated with the first element of the array.
44 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p>
45 <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>program</code></em>
46 is not the name of an existing program object.
47 </p><p>
48 <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>programInterface</code></em>
49 is not one of the accepted interface types.
50 </p><p>
51 <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>program</code></em>
52 has not been linked successfully.
53 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p>
54 <a href="glGetProgramResourceName.xml"><span class="citerefentry"><span class="refentrytitle">glGetProgramResourceName</span></span></a>,
55 <a href="glGetProgramResourceIndex.xml"><span class="citerefentry"><span class="refentrytitle">glGetProgramResourceIndex</span></span></a>,
56 <a href="glGetGetProgramResource.xml"><span class="citerefentry"><span class="refentrytitle">glGetGetProgramResource</span></span></a>,
57 <a href="glGetProgramResourceLocationIndex.xml"><span class="citerefentry"><span class="refentrytitle">glGetProgramResourceLocationIndex</span></span></a>.
58 </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p>
59 Copyright <span class="trademark"></span>© 2012 Khronos Group.
60 This material may be distributed subject to the terms and conditions set forth in
61 the Open Publication License, v 1.0, 8 June 1999.
62 <a href="http://opencontent.org/openpub/" target="_top">http://opencontent.org/openpub/</a>.
63 </p></div></div></body></html>