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=
"glGetActiveUniformBlockName">
9 <holder>Khronos Group
</holder>
12 <refentrytitle>glGetActiveUniformBlockName
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>glGetActiveUniformBlockName
</refname>
17 <refpurpose>retrieve the name of an active uniform block
</refpurpose>
19 <refsynopsisdiv><title>C Specification
</title>
22 <funcdef>void
<function>glGetActiveUniformBlockName
</function></funcdef>
23 <paramdef>GLuint
<parameter>program
</parameter></paramdef>
24 <paramdef>GLuint
<parameter>uniformBlockIndex
</parameter></paramdef>
25 <paramdef>GLsizei
<parameter>bufSize
</parameter></paramdef>
26 <paramdef>GLsizei *
<parameter>length
</parameter></paramdef>
27 <paramdef>GLchar *
<parameter>uniformBlockName
</parameter></paramdef>
31 <refsect1 id=
"parameters"><title>Parameters
</title>
34 <term><parameter>program
</parameter></term>
37 Specifies the name of a program containing the uniform block.
42 <term><parameter>uniformBlockIndex
</parameter></term>
45 Specifies the index of the uniform block within
<parameter>program
</parameter>.
50 <term><parameter>bufSize
</parameter></term>
53 Specifies the size of the buffer addressed by
<parameter>uniformBlockName
</parameter>.
58 <term><parameter>length
</parameter></term>
61 Specifies the address of a variable to receive the number of characters that were written to
<parameter>uniformBlockName
</parameter>.
66 <term><parameter>uniformBlockName
</parameter></term>
69 Specifies the address an array of characters to receive the name of the uniform block at
<parameter>uniformBlockIndex
</parameter>.
75 <refsect1 id=
"description"><title>Description
</title>
77 <function>glGetActiveUniformBlockName
</function> retrieves the name of the active uniform block at
<parameter>uniformBlockIndex
</parameter>
78 within
<parameter>program
</parameter>.
81 <parameter>program
</parameter> must be the name of a program object for which the command
82 <citerefentry><refentrytitle>glLinkProgram
</refentrytitle></citerefentry> must have been called in the past, although it is not required that
83 <citerefentry><refentrytitle>glLinkProgram
</refentrytitle></citerefentry> must have succeeded. The link could have failed because the number
84 of active uniforms exceeded the limit.
87 <parameter>uniformBlockIndex
</parameter> is an active uniform block index of
<parameter>program
</parameter>, and must be less than the value
88 of
<constant>GL_ACTIVE_UNIFORM_BLOCKS
</constant>.
91 Upon success, the name of the uniform block identified by
<parameter>unifomBlockIndex
</parameter> is returned into
92 <parameter>uniformBlockName
</parameter>. The name is nul-terminated. The actual number of characters written into
<parameter>uniformBlockName
</parameter>,
93 excluding the nul terminator, is returned in
<parameter>length
</parameter>. If
<parameter>length
</parameter> is
<code>NULL
</code>, no length is returned.
96 <parameter>bufSize
</parameter> contains the maximum number of characters (including the nul terminator) that will be written into
97 <parameter>uniformBlockName
</parameter>.
100 If an error occurs, nothing will be written to
<parameter>uniformBlockName
</parameter> or
<parameter>length
</parameter>.
103 <refsect1 id=
"errors"><title>Errors
</title>
105 <constant>GL_INVALID_OPERATION
</constant> is generated if
<parameter>program
</parameter> is not the name of a program object for which
106 <citerefentry><refentrytitle>glLinkProgram
</refentrytitle></citerefentry> has been called in the past.
109 <constant>GL_INVALID_VALUE
</constant> is generated if
<parameter>uniformBlockIndex
</parameter> is greater than or equal to the value
110 of
<constant>GL_ACTIVE_UNIFORM_BLOCKS
</constant> or is not the index of an active uniform block in
<parameter>program
</parameter>.
113 <refsect1 id=
"notes"><title>Notes
</title>
115 <function>glGetActiveUniformBlockName
</function> is available only if the GL version is
3.1 or greater.
118 <refsect1 id=
"seealso"><title>See Also
</title>
120 <citerefentry><refentrytitle>glGetActiveUniformBlock
</refentrytitle></citerefentry>,
121 <citerefentry><refentrytitle>glGetUniformBlockIndex
</refentrytitle></citerefentry>
124 <refsect1 id=
"Copyright"><title>Copyright
</title>
126 Copyright
<trademark class=
"copyright"></trademark> 2010 Khronos Group.
127 This material may be distributed subject to the terms and conditions set forth in
128 the Open Publication License, v
1.0,
8 June
1999.
129 <ulink url=
"http://opencontent.org/openpub/">http://opencontent.org/openpub/
</ulink>.