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 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glGetActiveUniformName">
<refentryinfo>
<copyright>
<year>2010-2013</year>
<holder>Khronos Group</holder>
</copyright>
</refentryinfo>
<refmeta>
<refentrytitle>glGetActiveUniformName</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glGetActiveUniformName</refname>
<refpurpose>query the name of an active uniform</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glGetActiveUniformName</function></funcdef>
<paramdef>GLuint <parameter>program</parameter></paramdef>
<paramdef>GLuint <parameter>uniformIndex</parameter></paramdef>
<paramdef>GLsizei <parameter>bufSize</parameter></paramdef>
<paramdef>GLsizei *<parameter>length</parameter></paramdef>
<paramdef>GLchar *<parameter>uniformName</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>program</parameter></term>
<listitem>
<para>
Specifies the program containing the active uniform index <parameter>uniformIndex</parameter>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>uniformIndex</parameter></term>
<listitem>
<para>
Specifies the index of the active uniform whose name to query.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>bufSize</parameter></term>
<listitem>
<para>
Specifies the size of the buffer, in units of <code>GLchar</code>, of the buffer whose address is specified in <parameter>uniformName</parameter>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>length</parameter></term>
<listitem>
<para>
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>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>uniformName</parameter></term>
<listitem>
<para>
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>.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
<function>glGetActiveUniformName</function> returns the name of the active uniform at <parameter>uniformIndex</parameter> within <parameter>program</parameter>.
If <parameter>uniformName</parameter> is not <code>NULL</code>, up to <parameter>bufSize</parameter> characters (including a nul-terminator) will be written into
the array whose address is specified by <parameter>uniformName</parameter>. If <parameter>length</parameter> is not <code>NULL</code>, the number of characters
that were (or would have been) written into <parameter>uniformName</parameter> (not including the nul-terminator) will be placed in the variable whose address
is specified in <parameter>length</parameter>. If <parameter>length</parameter> is <code>NULL</code>, no length is returned. The length of the longest uniform
name in <parameter>program</parameter> is given by the value of <constant>GL_ACTIVE_UNIFORM_MAX_LENGTH</constant>, which can be queried with
<citerefentry><refentrytitle>glGetProgram</refentrytitle></citerefentry>.
</para>
<para>
If <function>glGetActiveUniformName</function> is not successful, nothing is written to <parameter>length</parameter> or <parameter>uniformName</parameter>.
</para>
<para>
<parameter>program</parameter> must be the name of a program for which the command <citerefentry><refentrytitle>glLinkProgram</refentrytitle></citerefentry>
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
the number of active uniforms exceeded the limit.
</para>
<para>
<parameter>uniformIndex</parameter> must be an active uniform
index of the program <parameter>program</parameter>, in the
range zero to the value of
<constant>GL_ACTIVE_UNIFORMS</constant> minus one. The value of
<constant>GL_ACTIVE_UNIFORMS</constant> can be queried with
<citerefentry><refentrytitle>glGetProgram</refentrytitle></citerefentry>.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>uniformIndex</parameter> is greater than or equal to the value
of <constant>GL_ACTIVE_UNIFORMS</constant>.
</para>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>bufSize</parameter> is negative.
</para>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>program</parameter> is not the name of a program object for which
<citerefentry><refentrytitle>glLinkProgram</refentrytitle></citerefentry> has been issued.
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glGetActiveUniform</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glGetUniformIndices</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glGetProgram</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glLinkProgram</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"></trademark> 2010-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.
<ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
</para>
</refsect1>
</refentry>
|