2014-03-28 19:06:55 +00:00
|
|
|
<!DOCTYPE refentry [ <!ENTITY % mathent SYSTEM "math.ent"> %mathent; ]>
|
|
|
|
|
|
|
|
<!-- Converted by db4-upgrade version 1.1 -->
|
|
|
|
|
|
|
|
<refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="glGetActiveAttrib">
|
|
|
|
<info>
|
2013-11-03 11:43:50 +00:00
|
|
|
<copyright>
|
|
|
|
<year>2003-2005</year>
|
|
|
|
<holder>3Dlabs Inc. Ltd.</holder>
|
|
|
|
</copyright>
|
|
|
|
<copyright>
|
2014-03-28 19:06:55 +00:00
|
|
|
<year>2010-2014</year>
|
2013-11-03 11:43:50 +00:00
|
|
|
<holder>Khronos Group</holder>
|
|
|
|
</copyright>
|
2014-03-28 19:06:55 +00:00
|
|
|
</info>
|
2009-03-08 00:46:58 +00:00
|
|
|
<refmeta>
|
2013-11-03 11:43:50 +00:00
|
|
|
<refentrytitle>glGetActiveAttrib</refentrytitle>
|
|
|
|
<manvolnum>3G</manvolnum>
|
2009-03-08 00:46:58 +00:00
|
|
|
</refmeta>
|
|
|
|
<refnamediv>
|
2013-11-03 11:43:50 +00:00
|
|
|
<refname>glGetActiveAttrib</refname>
|
|
|
|
<refpurpose>Returns information about an active attribute variable for the specified program object</refpurpose>
|
2009-03-08 00:46:58 +00:00
|
|
|
</refnamediv>
|
2014-03-28 19:06:55 +00:00
|
|
|
<refsynopsisdiv>
|
|
|
|
<title>C Specification</title>
|
2010-11-21 14:34:29 +00:00
|
|
|
<funcsynopsis>
|
|
|
|
<funcprototype>
|
|
|
|
<funcdef>void <function>glGetActiveAttrib</function></funcdef>
|
|
|
|
<paramdef>GLuint <parameter>program</parameter></paramdef>
|
|
|
|
<paramdef>GLuint <parameter>index</parameter></paramdef>
|
|
|
|
<paramdef>GLsizei <parameter>bufSize</parameter></paramdef>
|
|
|
|
<paramdef>GLsizei *<parameter>length</parameter></paramdef>
|
|
|
|
<paramdef>GLint *<parameter>size</parameter></paramdef>
|
|
|
|
<paramdef>GLenum *<parameter>type</parameter></paramdef>
|
|
|
|
<paramdef>GLchar *<parameter>name</parameter></paramdef>
|
|
|
|
</funcprototype>
|
|
|
|
</funcsynopsis>
|
2009-03-08 00:46:58 +00:00
|
|
|
</refsynopsisdiv>
|
2014-03-28 19:06:55 +00:00
|
|
|
<refsect1 xml:id="parameters"><title>Parameters</title>
|
2010-11-21 14:34:29 +00:00
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>program</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>Specifies the program object to be
|
|
|
|
queried.</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>index</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>Specifies the index of the attribute variable
|
|
|
|
to be queried.</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>bufSize</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>Specifies the maximum number of characters
|
|
|
|
OpenGL is allowed to write in the character buffer
|
|
|
|
indicated by <parameter>name</parameter>.</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>length</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>Returns the number of characters actually
|
|
|
|
written by OpenGL in the string indicated by
|
|
|
|
<parameter>name</parameter> (excluding the null
|
|
|
|
terminator) if a value other than
|
|
|
|
<constant>NULL</constant> is passed.</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>size</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>Returns the size of the attribute
|
|
|
|
variable.</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>type</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>Returns the data type of the attribute
|
|
|
|
variable.</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>name</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>Returns a null terminated string containing
|
|
|
|
the name of the attribute variable.</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
2009-03-08 00:46:58 +00:00
|
|
|
</refsect1>
|
2014-03-28 19:06:55 +00:00
|
|
|
<refsect1 xml:id="description"><title>Description</title>
|
2010-11-21 14:34:29 +00:00
|
|
|
<para><function>glGetActiveAttrib</function> returns information
|
|
|
|
about an active attribute variable in the program object
|
|
|
|
specified by <parameter>program</parameter>. The number of
|
|
|
|
active attributes can be obtained by calling
|
2014-03-28 19:06:55 +00:00
|
|
|
<citerefentry><refentrytitle>glGetProgramiv</refentrytitle></citerefentry>
|
2010-11-21 14:34:29 +00:00
|
|
|
with the value <constant>GL_ACTIVE_ATTRIBUTES</constant>. A
|
2014-03-28 19:06:55 +00:00
|
|
|
value of zero for <parameter>index</parameter> selects the first
|
2010-11-21 14:34:29 +00:00
|
|
|
active attribute variable. Permissible values for
|
2013-12-15 21:32:32 +00:00
|
|
|
<parameter>index</parameter> range from zero to the number of
|
|
|
|
active attribute variables minus one.</para>
|
2009-03-08 00:46:58 +00:00
|
|
|
|
2014-03-28 19:06:55 +00:00
|
|
|
<para>Attribute variables have arbitrary names and obtain their values
|
|
|
|
through numbered generic vertex attributes. An attribute
|
|
|
|
variable is considered active
|
2010-11-21 14:34:29 +00:00
|
|
|
if it is determined during the link operation that it may be
|
|
|
|
accessed during program execution. Therefore,
|
|
|
|
<parameter>program</parameter> should have previously been the
|
|
|
|
target of a call to
|
|
|
|
<citerefentry><refentrytitle>glLinkProgram</refentrytitle></citerefentry>,
|
|
|
|
but it is not necessary for it to have been linked
|
|
|
|
successfully.</para>
|
2009-03-08 00:46:58 +00:00
|
|
|
|
2010-11-21 14:34:29 +00:00
|
|
|
<para>The size of the character buffer required to store the
|
|
|
|
longest attribute variable name in
|
|
|
|
<parameter>program</parameter> can be obtained by calling
|
2014-03-28 19:06:55 +00:00
|
|
|
<citerefentry><refentrytitle>glGetProgramiv</refentrytitle></citerefentry>
|
2010-11-21 14:34:29 +00:00
|
|
|
with the value
|
|
|
|
<constant>GL_ACTIVE_ATTRIBUTE_MAX_LENGTH</constant>. This value
|
|
|
|
should be used to allocate a buffer of sufficient size to store
|
|
|
|
the returned attribute name. The size of this character buffer
|
|
|
|
is passed in <parameter>bufSize</parameter>, and a pointer to
|
|
|
|
this character buffer is passed in
|
|
|
|
<parameter>name</parameter>.</para>
|
2009-03-08 00:46:58 +00:00
|
|
|
|
2010-11-21 14:34:29 +00:00
|
|
|
<para><function>glGetActiveAttrib</function> returns the name of
|
|
|
|
the attribute variable indicated by
|
|
|
|
<parameter>index</parameter>, storing it in the character buffer
|
|
|
|
specified by <parameter>name</parameter>. The string returned
|
|
|
|
will be null terminated. The actual number of characters written
|
|
|
|
into this buffer is returned in <parameter>length</parameter>,
|
|
|
|
and this count does not include the null termination character.
|
|
|
|
If the length of the returned string is not required, a value of
|
|
|
|
<constant>NULL</constant> can be passed in the
|
|
|
|
<parameter>length</parameter> argument.</para>
|
2009-03-08 00:46:58 +00:00
|
|
|
|
2014-03-28 19:06:55 +00:00
|
|
|
<para>The <parameter>type</parameter> argument will return a
|
|
|
|
pointer to the attribute variable's data type. The symbolic
|
2010-11-21 14:34:29 +00:00
|
|
|
constants <constant>GL_FLOAT</constant>,
|
|
|
|
<constant>GL_FLOAT_VEC2</constant>,
|
|
|
|
<constant>GL_FLOAT_VEC3</constant>,
|
|
|
|
<constant>GL_FLOAT_VEC4</constant>,
|
|
|
|
<constant>GL_FLOAT_MAT2</constant>,
|
|
|
|
<constant>GL_FLOAT_MAT3</constant>,
|
|
|
|
<constant>GL_FLOAT_MAT4</constant>,
|
|
|
|
<constant>GL_FLOAT_MAT2x3</constant>,
|
|
|
|
<constant>GL_FLOAT_MAT2x4</constant>,
|
|
|
|
<constant>GL_FLOAT_MAT3x2</constant>,
|
|
|
|
<constant>GL_FLOAT_MAT3x4</constant>,
|
|
|
|
<constant>GL_FLOAT_MAT4x2</constant>,
|
|
|
|
<constant>GL_FLOAT_MAT4x3</constant>,
|
|
|
|
<constant>GL_INT</constant>,
|
|
|
|
<constant>GL_INT_VEC2</constant>,
|
|
|
|
<constant>GL_INT_VEC3</constant>,
|
|
|
|
<constant>GL_INT_VEC4</constant>,
|
2013-10-23 18:17:08 +00:00
|
|
|
<constant>GL_UNSIGNED_INT</constant>,
|
2010-11-21 14:34:29 +00:00
|
|
|
<constant>GL_UNSIGNED_INT_VEC2</constant>,
|
2014-03-28 19:06:55 +00:00
|
|
|
<constant>GL_UNSIGNED_INT_VEC3</constant>, or
|
|
|
|
<constant>GL_UNSIGNED_INT_VEC4</constant> may be returned. The
|
2010-11-21 14:34:29 +00:00
|
|
|
<parameter>size</parameter> argument will return the size of the
|
|
|
|
attribute, in units of the type returned in
|
|
|
|
<parameter>type</parameter>.</para>
|
2009-03-08 00:46:58 +00:00
|
|
|
|
2010-11-21 14:34:29 +00:00
|
|
|
<para>This function will return as much information as it can
|
|
|
|
about the specified active attribute variable. If no information
|
|
|
|
is available, <parameter>length</parameter> will be 0, and
|
|
|
|
<parameter>name</parameter> will be an empty string. This
|
|
|
|
situation could occur if this function is called after a link
|
|
|
|
operation that failed. If an error occurs, the return values
|
|
|
|
<parameter>length</parameter>, <parameter>size</parameter>,
|
|
|
|
<parameter>type</parameter>, and <parameter>name</parameter>
|
|
|
|
will be unmodified.</para>
|
2009-03-08 00:46:58 +00:00
|
|
|
</refsect1>
|
2014-03-28 19:06:55 +00:00
|
|
|
<refsect1 xml:id="errors"><title>Errors</title>
|
2010-11-21 14:34:29 +00:00
|
|
|
<para><constant>GL_INVALID_VALUE</constant> is generated if
|
|
|
|
<parameter>program</parameter> is not a value generated by
|
|
|
|
OpenGL.</para>
|
2009-03-08 00:46:58 +00:00
|
|
|
|
2010-11-21 14:34:29 +00:00
|
|
|
<para><constant>GL_INVALID_OPERATION</constant> is generated if
|
|
|
|
<parameter>program</parameter> is not a program object.</para>
|
2009-03-08 00:46:58 +00:00
|
|
|
|
2010-11-21 14:34:29 +00:00
|
|
|
<para><constant>GL_INVALID_VALUE</constant> is generated if
|
|
|
|
<parameter>index</parameter> is greater than or equal to the
|
|
|
|
number of active attribute variables in
|
|
|
|
<parameter>program</parameter>.</para>
|
2009-03-08 00:46:58 +00:00
|
|
|
|
2010-11-21 14:34:29 +00:00
|
|
|
<para><constant>GL_INVALID_VALUE</constant> is generated if
|
|
|
|
<parameter>bufSize</parameter> is less than 0.</para>
|
2009-03-08 00:46:58 +00:00
|
|
|
</refsect1>
|
2014-03-28 19:06:55 +00:00
|
|
|
<refsect1 xml:id="associatedgets"><title>Associated Gets</title>
|
2010-11-21 14:34:29 +00:00
|
|
|
<para><citerefentry><refentrytitle>glGet</refentrytitle></citerefentry>
|
|
|
|
with argument <constant>GL_MAX_VERTEX_ATTRIBS</constant>.</para>
|
2009-03-08 00:46:58 +00:00
|
|
|
|
2014-03-28 19:06:55 +00:00
|
|
|
<para><citerefentry><refentrytitle>glGetProgramiv</refentrytitle></citerefentry>
|
2010-11-21 14:34:29 +00:00
|
|
|
with argument <constant>GL_ACTIVE_ATTRIBUTES</constant> or
|
|
|
|
<constant>GL_ACTIVE_ATTRIBUTE_MAX_LENGTH</constant>.</para>
|
2009-03-08 00:46:58 +00:00
|
|
|
|
2010-11-21 14:34:29 +00:00
|
|
|
<para><citerefentry><refentrytitle>glIsProgram</refentrytitle></citerefentry></para>
|
2009-03-08 00:46:58 +00:00
|
|
|
</refsect1>
|
2014-03-28 19:06:55 +00:00
|
|
|
<refsect1 xml:id="versions">
|
|
|
|
<title>API Version Support</title>
|
|
|
|
<informaltable>
|
|
|
|
<tgroup cols="4" align="left">
|
|
|
|
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="apifunchead.xml" xpointer="xpointer(/*/*)"/>
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry>glGetActiveAttrib</entry>
|
|
|
|
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="apiversion.xml" xpointer="xpointer(/*/*[@role='es20']/*)"/>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</informaltable>
|
|
|
|
</refsect1>
|
|
|
|
<refsect1 xml:id="seealso"><title>See Also</title>
|
2010-11-21 14:34:29 +00:00
|
|
|
<para><citerefentry><refentrytitle>glBindAttribLocation</refentrytitle></citerefentry>,
|
|
|
|
<citerefentry><refentrytitle>glLinkProgram</refentrytitle></citerefentry>,
|
|
|
|
<citerefentry><refentrytitle>glVertexAttrib</refentrytitle></citerefentry>,
|
|
|
|
<citerefentry><refentrytitle>glVertexAttribPointer</refentrytitle></citerefentry></para>
|
2009-03-08 00:46:58 +00:00
|
|
|
</refsect1>
|
2014-03-28 19:06:55 +00:00
|
|
|
<refsect1 xml:id="Copyright"><title>Copyright</title>
|
2009-03-08 00:46:58 +00:00
|
|
|
<para>
|
2014-03-28 19:06:55 +00:00
|
|
|
Copyright <trademark class="copyright"/> 2003-2005 3Dlabs Inc. Ltd.
|
|
|
|
Copyright <trademark class="copyright"/> 2010-2014 Khronos Group.
|
2013-11-03 11:43:50 +00:00
|
|
|
This material may be distributed subject to the terms and conditions set forth in
|
2009-03-08 00:46:58 +00:00
|
|
|
the Open Publication License, v 1.0, 8 June 1999.
|
2014-03-28 19:06:55 +00:00
|
|
|
<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://opencontent.org/openpub/">http://opencontent.org/openpub/</link>.
|
2009-03-08 00:46:58 +00:00
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
</refentry>
|