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=
"glGetActiveUniformName">
9 <holder>Khronos Group
</holder>
12 <refentrytitle>glGetActiveUniformName
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>glGetActiveUniformName
</refname>
17 <refpurpose>query the name of an active uniform
</refpurpose>
19 <refsynopsisdiv><title>C Specification
</title>
22 <funcdef>void
<function>glGetActiveUniformName
</function></funcdef>
23 <paramdef>GLuint
<parameter>program
</parameter></paramdef>
24 <paramdef>GLuint
<parameter>uniformIndex
</parameter></paramdef>
25 <paramdef>GLsizei
<parameter>bufSize
</parameter></paramdef>
26 <paramdef>GLsizei *
<parameter>length
</parameter></paramdef>
27 <paramdef>GLchar *
<parameter>uniformName
</parameter></paramdef>
31 <!-- eqn: ignoring delim $$ -->
32 <refsect1 id=
"parameters"><title>Parameters
</title>
35 <term><parameter>program
</parameter></term>
38 Specifies the program containing the active uniform index
<parameter>uniformIndex
</parameter>.
43 <term><parameter>uniformIndex
</parameter></term>
46 Specifies the index of the active uniform whose name to query.
51 <term><parameter>bufSize
</parameter></term>
54 Specifies the size of the buffer, in units of
<code>GLchar
</code>, of the buffer whose address is specified in
<parameter>uniformName
</parameter>.
59 <term><parameter>length
</parameter></term>
62 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
<parameter>uniformName
</parameter>.
67 <term><parameter>uniformName
</parameter></term>
70 Specifies the address of a buffer into which the GL will place the name of the active uniform at
<parameter>uniformIndex
</parameter> within
<parameter>program
</parameter>.
76 <refsect1 id=
"description"><title>Description
</title>
78 <function>glGetActiveUniformName
</function> returns the name of the active uniform at
<parameter>uniformIndex
</parameter> within
<parameter>program
</parameter>.
79 If
<parameter>uniformName
</parameter> is not
<code>NULL
</code>, up to
<parameter>bufSize
</parameter> characters (including a nul-terminator) will be written into
80 the array whose address is specified by
<parameter>uniformName
</parameter>. If
<parameter>length
</parameter> is not
<code>NULL
</code>, the number of characters
81 that were (or would have been) written into
<parameter>uniformName
</parameter> (not including the nul-terminator) will be placed in the variable whose address
82 is specified in
<parameter>length
</parameter>. If
<parameter>length
</parameter> is
<code>NULL
</code>, no length is returned. The length of the longest uniform
83 name in
<parameter>program
</parameter> is given by the value of
<constant>GL_ACTIVE_UNIFORM_MAX_LENGTH
</constant>, which can be queried with
84 <citerefentry><refentrytitle>glGetProgram
</refentrytitle></citerefentry>.
87 If
<function>glGetActiveUniformName
</function> is not successful, nothing is written to
<parameter>length
</parameter> or
<parameter>uniformName
</parameter>.
90 <parameter>program
</parameter> must be the name of a program for which the command
<citerefentry><refentrytitle>glLinkProgram
</refentrytitle></citerefentry>
91 has been issued in the past. It is not necessary for
<parameter>program
</parameter> to have been linked successfully. The link could have failed because
92 the number of active uniforms exceeded the limit.
95 <parameter>uniformIndex
</parameter> must be an active uniform index of the program
<parameter>program
</parameter>, in the range zero to
96 <constant>GL_ACTIVE_UNIFORMS
</constant> -
1. The value of
<constant>GL_ACTIVE_UNIFORMS
</constant> can be queried with
97 <citerefentry><refentrytitle>glGetProgram
</refentrytitle></citerefentry>.
100 <refsect1 id=
"errors"><title>Errors
</title>
102 <constant>GL_INVALID_VALUE
</constant> is generated if
<parameter>uniformIndex
</parameter> is greater than or equal to the value
103 of
<constant>GL_ACTIVE_UNIFORMS
</constant>.
106 <constant>GL_INVALID_VALUE
</constant> is generated if
<parameter>bufSize
</parameter> is negative.
109 <constant>GL_INVALID_VALUE
</constant> is generated if
<parameter>program
</parameter> is not the name of a program object for which
110 <citerefentry><refentrytitle>glLinkProgram
</refentrytitle></citerefentry> has been issued.
113 <refsect1 id=
"seealso"><title>See Also
</title>
115 <citerefentry><refentrytitle>glGetActiveUniform
</refentrytitle></citerefentry>,
116 <citerefentry><refentrytitle>glGetUniformIndices
</refentrytitle></citerefentry>,
117 <citerefentry><refentrytitle>glGetProgram
</refentrytitle></citerefentry>,
118 <citerefentry><refentrytitle>glLinkProgram
</refentrytitle></citerefentry>
121 <refsect1 id=
"Copyright"><title>Copyright
</title>
123 Copyright
<trademark class=
"copyright"></trademark> 2010 Khronos Group.
124 This material may be distributed subject to the terms and conditions set forth in
125 the Open Publication License, v
1.0,
8 June
1999.
126 <ulink url=
"http://opencontent.org/openpub/">http://opencontent.org/openpub/
</ulink>.