Commit | Line | Data |
---|---|---|
7faf1d71 AW |
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>glGetProgramResourceLocation - 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="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" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">GLint <b class="fsfunc">glGetProgramResourceLocation</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 location 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">GL_UNIFORM</code>, <code class="constant">GL_PROGRAM_INPUT</code>, <code class="constant">GL_PROGRAM_OUTPUT</code>, | |
16 | <code class="constant">GL_VERTEX_SUBROUTINE_UNIFORM</code>, <code class="constant">GL_TESS_CONTROL_SUBROUTINE_UNIFORM</code>, | |
17 | <code class="constant">GL_TESS_EVALUATION_SUBROUTINE_UNIFORM</code>, <code class="constant">GL_GEOMETRY_SUBROUTINE_UNIFORM</code>, | |
18 | <code class="constant">GL_FRAGMENT_SUBROUTINE_UNIFORM</code>, or <code class="constant">GL_COMPUTE_SUBROUTINE_UNIFORM</code>. | |
19 | 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 | |
20 | <em class="parameter"><code>programInterface</code></em>, or if <em class="parameter"><code>name</code></em> identifies an active variable that does | |
21 | not have a valid location assigned, as described above. The locations | |
22 | returned by these commands are the same locations returned when querying | |
23 | the <code class="constant">GL_LOCATION</code> and <code class="constant">GL_LOCATION_INDEX</code> resource properties. | |
24 | </p><p> | |
25 | A string provided to <code class="function">glGetProgramResourceLocation</code> is considered to match an active variable if: | |
26 | </p><div class="itemizedlist"><ul type="disc"><li><p> | |
27 | the string exactly matches the name of the active variable | |
28 | </p></li><li><p> | |
29 | if the string identifies the base name of an active array, where the | |
30 | string would exactly match the name of the variable if the suffix | |
31 | "[0]" were appended to the string | |
32 | </p></li><li><p> | |
33 | if the string identifies an active element of the array, where the | |
34 | string ends with the concatenation of the "[" character, an integer | |
35 | <span class="emphasis"><em>with no "+" sign, extra leading zeroes, or whitespace</em></span> identifying an | |
36 | array element, and the "]" character, the integer is less than the | |
37 | number of active elements of the array variable, and where the string | |
38 | would exactly match the enumerated name of the array if the decimal | |
39 | integer were replaced with zero. | |
40 | </p></li></ul></div><p> | |
41 | Any other string is considered not to identify an active variable. If the | |
42 | string specifies an element of an array variable, | |
43 | <code class="function">glGetProgramResourceLocation</code> returns the | |
44 | location assigned to that element. If it | |
45 | specifies the base name of an array, it identifies the resources | |
46 | associated with the first element of the array. | |
47 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p> | |
48 | <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>program</code></em> | |
49 | is not the name of an existing program object. | |
50 | </p><p> | |
51 | <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>programInterface</code></em> | |
52 | is not one of the accepted interface types. | |
53 | </p><p> | |
54 | <code class="constant">GL_INVALID_OPERATION</code> is generated if <em class="parameter"><code>program</code></em> | |
55 | has not been linked successfully. | |
56 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p> | |
57 | <a href="glGetProgramResourceName.xml"><span class="citerefentry"><span class="refentrytitle">glGetProgramResourceName</span></span></a>, | |
58 | <a href="glGetProgramResourceIndex.xml"><span class="citerefentry"><span class="refentrytitle">glGetProgramResourceIndex</span></span></a>, | |
59 | <a href="glGetGetProgramResource.xml"><span class="citerefentry"><span class="refentrytitle">glGetGetProgramResource</span></span></a>, | |
60 | <a href="glGetProgramResourceLocationIndex.xml"><span class="citerefentry"><span class="refentrytitle">glGetProgramResourceLocationIndex</span></span></a>. | |
61 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p> | |
62 | Copyright <span class="trademark"></span>© 2012 Khronos Group. | |
63 | This material may be distributed subject to the terms and conditions set forth in | |
64 | the Open Publication License, v 1.0, 8 June 1999. | |
65 | <a href="http://opencontent.org/openpub/" target="_top">http://opencontent.org/openpub/</a>. | |
66 | </p></div></div></body></html> |