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=
"glGetUniformBlockIndex">
9 <holder>Khronos Group
</holder>
12 <refentrytitle>glGetUniformBlockIndex
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>glGetUniformBlockIndex
</refname>
17 <refpurpose>retrieve the index of a named uniform block
</refpurpose>
19 <refsynopsisdiv><title>C Specification
</title>
22 <funcdef>GLuint
<function>glGetUniformBlockIndex
</function></funcdef>
23 <paramdef>GLuint
<parameter>program
</parameter></paramdef>
24 <paramdef>const GLchar *
<parameter>uniformBlockName
</parameter></paramdef>
28 <refsect1 id=
"parameters"><title>Parameters
</title>
31 <term><parameter>program
</parameter></term>
34 Specifies the name of a program containing the uniform block.
39 <term><parameter>uniformBlockName
</parameter></term>
42 Specifies the address an array of characters to containing the name of the uniform block whose index to retrieve.
48 <refsect1 id=
"description"><title>Description
</title>
50 <function>glGetUniformBlockIndex
</function> retrieves the index of a uniform block within
<parameter>program
</parameter>.
53 <parameter>program
</parameter> must be the name of a program object for which the command
54 <citerefentry><refentrytitle>glLinkProgram
</refentrytitle></citerefentry> must have been called in the past, although it is not required that
55 <citerefentry><refentrytitle>glLinkProgram
</refentrytitle></citerefentry> must have succeeded. The link could have failed because the number
56 of active uniforms exceeded the limit.
59 <parameter>uniformBlockName
</parameter> must contain a nul-terminated string specifying the name of the uniform block.
62 <function>glGetUniformBlockIndex
</function> returns the uniform block index for the uniform block named
<parameter>uniformBlockName
</parameter>
63 of
<parameter>program
</parameter>. If
<parameter>uniformBlockName
</parameter> does not identify an active uniform block of
<parameter>program
</parameter>,
64 <function>glGetUniformBlockIndex
</function> returns the special identifier,
<constant>GL_INVALID_INDEX
</constant>. Indices of the active uniform
65 blocks of a program are assigned in consecutive order, beginning with zero.
68 <refsect1 id=
"errors"><title>Errors
</title>
70 <constant>GL_INVALID_OPERATION
</constant> is generated if
<parameter>program
</parameter> is not the name of a program object for which
71 <citerefentry><refentrytitle>glLinkProgram
</refentrytitle></citerefentry> has been called in the past.
74 <refsect1 id=
"notes"><title>Notes
</title>
76 <function>glGetUniformBlockIndex
</function> is available only if the GL version is
3.1 or greater.
79 <refsect1 id=
"seealso"><title>See Also
</title>
81 <citerefentry><refentrytitle>glGetActiveUniformBlockName
</refentrytitle></citerefentry>,
82 <citerefentry><refentrytitle>glGetActiveUniformBlock
</refentrytitle></citerefentry>,
83 <citerefentry><refentrytitle>glLinkProgram
</refentrytitle></citerefentry>
86 <refsect1 id=
"Copyright"><title>Copyright
</title>
88 Copyright
<trademark class=
"copyright"></trademark> 2010 Khronos Group.
89 This material may be distributed subject to the terms and conditions set forth in
90 the Open Publication License, v
1.0,
8 June
1999.
91 <ulink url=
"http://opencontent.org/openpub/">http://opencontent.org/openpub/
</ulink>.