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