Commit | Line | Data |
---|---|---|
7faf1d71 AW |
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"> | |
5 | <refmeta> | |
6 | <refmetainfo> | |
7 | <copyright> | |
8 | <year>2010</year> | |
9 | <holder>Khronos Group</holder> | |
10 | </copyright> | |
11 | </refmetainfo> | |
12 | <refentrytitle>glGetActiveUniformName</refentrytitle> | |
13 | <manvolnum>3G</manvolnum> | |
14 | </refmeta> | |
15 | <refnamediv> | |
16 | <refname>glGetActiveUniformName</refname> | |
17 | <refpurpose>query the name of an active uniform</refpurpose> | |
18 | </refnamediv> | |
19 | <refsynopsisdiv><title>C Specification</title> | |
20 | <funcsynopsis> | |
21 | <funcprototype> | |
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> | |
28 | </funcprototype> | |
29 | </funcsynopsis> | |
30 | </refsynopsisdiv> | |
31 | <!-- eqn: ignoring delim $$ --> | |
32 | <refsect1 id="parameters"><title>Parameters</title> | |
33 | <variablelist> | |
34 | <varlistentry> | |
35 | <term><parameter>program</parameter></term> | |
36 | <listitem> | |
37 | <para> | |
38 | Specifies the program containing the active uniform index <parameter>uniformIndex</parameter>. | |
39 | </para> | |
40 | </listitem> | |
41 | </varlistentry> | |
42 | <varlistentry> | |
43 | <term><parameter>uniformIndex</parameter></term> | |
44 | <listitem> | |
45 | <para> | |
46 | Specifies the index of the active uniform whose name to query. | |
47 | </para> | |
48 | </listitem> | |
49 | </varlistentry> | |
50 | <varlistentry> | |
51 | <term><parameter>bufSize</parameter></term> | |
52 | <listitem> | |
53 | <para> | |
54 | Specifies the size of the buffer, in units of <code>GLchar</code>, of the buffer whose address is specified in <parameter>uniformName</parameter>. | |
55 | </para> | |
56 | </listitem> | |
57 | </varlistentry> | |
58 | <varlistentry> | |
59 | <term><parameter>length</parameter></term> | |
60 | <listitem> | |
61 | <para> | |
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>. | |
63 | </para> | |
64 | </listitem> | |
65 | </varlistentry> | |
66 | <varlistentry> | |
67 | <term><parameter>uniformName</parameter></term> | |
68 | <listitem> | |
69 | <para> | |
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>. | |
71 | </para> | |
72 | </listitem> | |
73 | </varlistentry> | |
74 | </variablelist> | |
75 | </refsect1> | |
76 | <refsect1 id="description"><title>Description</title> | |
77 | <para> | |
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>. | |
85 | </para> | |
86 | <para> | |
87 | If <function>glGetActiveUniformName</function> is not successful, nothing is written to <parameter>length</parameter> or <parameter>uniformName</parameter>. | |
88 | </para> | |
89 | <para> | |
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. | |
93 | </para> | |
94 | <para> | |
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>. | |
98 | </para> | |
99 | </refsect1> | |
100 | <refsect1 id="errors"><title>Errors</title> | |
101 | <para> | |
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>. | |
104 | </para> | |
105 | <para> | |
106 | <constant>GL_INVALID_VALUE</constant> is generated if <parameter>bufSize</parameter> is negative. | |
107 | </para> | |
108 | <para> | |
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. | |
111 | </para> | |
112 | </refsect1> | |
113 | <refsect1 id="seealso"><title>See Also</title> | |
114 | <para> | |
115 | <citerefentry><refentrytitle>glGetActiveUniform</refentrytitle></citerefentry>, | |
116 | <citerefentry><refentrytitle>glGetUniformIndices</refentrytitle></citerefentry>, | |
117 | <citerefentry><refentrytitle>glGetProgram</refentrytitle></citerefentry>, | |
118 | <citerefentry><refentrytitle>glLinkProgram</refentrytitle></citerefentry> | |
119 | </para> | |
120 | </refsect1> | |
121 | <refsect1 id="Copyright"><title>Copyright</title> | |
122 | <para> | |
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>. | |
127 | </para> | |
128 | </refsect1> | |
129 | </refentry> |