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>glGetActiveUniformName - 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=
"glGetActiveUniformName"></a><div class=
"titlepage"></div><div class=
"refnamediv"><h2>Name
</h2><p>glGetActiveUniformName — query the name of an active uniform
</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">void
<b class=
"fsfunc">glGetActiveUniformName
</b>(
</code></td><td>GLuint
</td><td><var class=
"pdparam">program
</var>,
</td></tr><tr><td> </td><td>GLuint
</td><td><var class=
"pdparam">uniformIndex
</var>,
</td></tr><tr><td> </td><td>GLsizei
</td><td><var class=
"pdparam">bufSize
</var>,
</td></tr><tr><td> </td><td>GLsizei *
</td><td><var class=
"pdparam">length
</var>,
</td></tr><tr><td> </td><td>GLchar *
</td><td><var class=
"pdparam">uniformName
</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 Specifies the program containing the active uniform index
<em class=
"parameter"><code>uniformIndex
</code></em>.
6 </p></dd><dt><span class=
"term"><em class=
"parameter"><code>uniformIndex
</code></em></span></dt><dd><p>
7 Specifies the index of the active uniform whose name to query.
8 </p></dd><dt><span class=
"term"><em class=
"parameter"><code>bufSize
</code></em></span></dt><dd><p>
9 Specifies the size of the buffer, in units of
<code class=
"code">GLchar
</code>, of the buffer whose address is specified in
<em class=
"parameter"><code>uniformName
</code></em>.
10 </p></dd><dt><span class=
"term"><em class=
"parameter"><code>length
</code></em></span></dt><dd><p>
11 Specifies the address of a variable that will receive the number of characters that were or would have been written to the buffer addressed by
<em class=
"parameter"><code>uniformName
</code></em>.
12 </p></dd><dt><span class=
"term"><em class=
"parameter"><code>uniformName
</code></em></span></dt><dd><p>
13 Specifies the address of a buffer into which the GL will place the name of the active uniform at
<em class=
"parameter"><code>uniformIndex
</code></em> within
<em class=
"parameter"><code>program
</code></em>.
14 </p></dd></dl></div></div><div class=
"refsect1" lang=
"en" xml:
lang=
"en"><a id=
"description"></a><h2>Description
</h2><p>
15 <code class=
"function">glGetActiveUniformName
</code> returns the name of the active uniform at
<em class=
"parameter"><code>uniformIndex
</code></em> within
<em class=
"parameter"><code>program
</code></em>.
16 If
<em class=
"parameter"><code>uniformName
</code></em> is not
<code class=
"code">NULL
</code>, up to
<em class=
"parameter"><code>bufSize
</code></em> characters (including a nul-terminator) will be written into
17 the array whose address is specified by
<em class=
"parameter"><code>uniformName
</code></em>. If
<em class=
"parameter"><code>length
</code></em> is not
<code class=
"code">NULL
</code>, the number of characters
18 that were (or would have been) written into
<em class=
"parameter"><code>uniformName
</code></em> (not including the nul-terminator) will be placed in the variable whose address
19 is specified in
<em class=
"parameter"><code>length
</code></em>. If
<em class=
"parameter"><code>length
</code></em> is
<code class=
"code">NULL
</code>, no length is returned. The length of the longest uniform
20 name in
<em class=
"parameter"><code>program
</code></em> is given by the value of
<code class=
"constant">GL_ACTIVE_UNIFORM_MAX_LENGTH
</code>, which can be queried with
21 <a href=
"glGetProgram.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glGetProgram
</span></span></a>.
23 If
<code class=
"function">glGetActiveUniformName
</code> is not successful, nothing is written to
<em class=
"parameter"><code>length
</code></em> or
<em class=
"parameter"><code>uniformName
</code></em>.
25 <em class=
"parameter"><code>program
</code></em> must be the name of a program for which the command
<a href=
"glLinkProgram.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glLinkProgram
</span></span></a>
26 has been issued in the past. It is not necessary for
<em class=
"parameter"><code>program
</code></em> to have been linked successfully. The link could have failed because
27 the number of active uniforms exceeded the limit.
29 <em class=
"parameter"><code>uniformIndex
</code></em> must be an active uniform index of the program
<em class=
"parameter"><code>program
</code></em>, in the range zero to
30 <code class=
"constant">GL_ACTIVE_UNIFORMS
</code> -
1. The value of
<code class=
"constant">GL_ACTIVE_UNIFORMS
</code> can be queried with
31 <a href=
"glGetProgram.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glGetProgram
</span></span></a>.
32 </p></div><div class=
"refsect1" lang=
"en" xml:
lang=
"en"><a id=
"errors"></a><h2>Errors
</h2><p>
33 <code class=
"constant">GL_INVALID_VALUE
</code> is generated if
<em class=
"parameter"><code>uniformIndex
</code></em> is greater than or equal to the value
34 of
<code class=
"constant">GL_ACTIVE_UNIFORMS
</code>.
36 <code class=
"constant">GL_INVALID_VALUE
</code> is generated if
<em class=
"parameter"><code>bufSize
</code></em> is negative.
38 <code class=
"constant">GL_INVALID_VALUE
</code> is generated if
<em class=
"parameter"><code>program
</code></em> is not the name of a program object for which
39 <a href=
"glLinkProgram.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glLinkProgram
</span></span></a> has been issued.
40 </p></div><div class=
"refsect1" lang=
"en" xml:
lang=
"en"><a id=
"seealso"></a><h2>See Also
</h2><p>
41 <a href=
"glGetActiveUniform.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glGetActiveUniform
</span></span></a>,
42 <a href=
"glGetUniformIndices.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glGetUniformIndices
</span></span></a>,
43 <a href=
"glGetProgram.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glGetProgram
</span></span></a>,
44 <a href=
"glLinkProgram.xml"><span class=
"citerefentry"><span class=
"refentrytitle">glLinkProgram
</span></span></a>
45 </p></div><div class=
"refsect1" lang=
"en" xml:
lang=
"en"><a id=
"Copyright"></a><h2>Copyright
</h2><p>
46 Copyright
<span class=
"trademark"></span>©
2010 Khronos Group.
47 This material may be distributed subject to the terms and conditions set forth in
48 the Open Publication License, v
1.0,
8 June
1999.
49 <a href=
"http://opencontent.org/openpub/" target=
"_top">http://opencontent.org/openpub/
</a>.
50 </p></div></div></body></html>