Subversion Repositories AndroidProjects

Rev

Blame | Last modification | View Log | RSS feed

<?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="glGetProgram">
    <refmeta>
        <refentrytitle>glGetProgram</refentrytitle>
        <manvolnum>3G</manvolnum>
    </refmeta>
    <refnamediv>
        <refname>glGetProgramiv</refname>
        <refpurpose>Returns a parameter from a program object</refpurpose>
    </refnamediv>
    <refsynopsisdiv><title>C Specification</title>
        <funcsynopsis>
            <funcprototype>
                <funcdef>void <function>glGetProgramiv</function></funcdef>
                <paramdef>GLuint <parameter>program</parameter></paramdef>
                <paramdef>GLenum <parameter>pname</parameter></paramdef>
                <paramdef>GLint *<parameter>params</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>
    <refsect1 id="parameters"><title>Parameters</title>
        <variablelist>
            <varlistentry>
                <term><parameter>program</parameter></term>
                <listitem>
                    <para>Specifies the program object to be
                    queried.</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term><parameter>pname</parameter></term>
                <listitem>
                    <para>Specifies the object parameter. Accepted
                    symbolic names are
                    <constant>GL_DELETE_STATUS</constant>,
                    <constant>GL_LINK_STATUS</constant>,
                    <constant>GL_VALIDATE_STATUS</constant>,
                    <constant>GL_INFO_LOG_LENGTH</constant>,
                    <constant>GL_ATTACHED_SHADERS</constant>,
                    <constant>GL_ACTIVE_ATTRIBUTES</constant>,
                    <constant>GL_ACTIVE_ATTRIBUTE_MAX_LENGTH</constant>,
                    <constant>GL_ACTIVE_UNIFORMS</constant>,
                    <constant>GL_ACTIVE_UNIFORM_MAX_LENGTH</constant>.</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term><parameter>params</parameter></term>
                <listitem>
                    <para>Returns the requested object parameter.</para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsect1>
    <refsect1 id="description"><title>Description</title>
        <para><function>glGetProgram</function>
        returns in <parameter>params</parameter>
        the value of a parameter for a specific program object. The following parameters are defined:</para>

        <variablelist>
            <varlistentry>
                <term><constant>GL_DELETE_STATUS</constant></term>
                <listitem>
                    <para>
                    </para>
                    <para> <parameter>params</parameter> returns
                    <constant>GL_TRUE</constant> if
                    <parameter>program</parameter> is currently flagged
                    for deletion, and <constant>GL_FALSE</constant>
                    otherwise.</para>
                </listitem>
            </varlistentry>

            <varlistentry>
                <term><constant>GL_LINK_STATUS</constant></term>
                <listitem>
                    <para>
                    </para>
                    <para> <parameter>params</parameter> returns
                    <constant>GL_TRUE</constant> if the last link
                    operation on <parameter>program</parameter> was
                    successful, and <constant>GL_FALSE</constant>
                    otherwise.</para>
                </listitem>
            </varlistentry>

            <varlistentry>
                <term><constant>GL_VALIDATE_STATUS</constant></term>
                <listitem>
                    <para>
                    </para>
                    <para> <parameter>params</parameter> returns
                    <constant>GL_TRUE</constant> or if the last
                    validation operation on
                    <parameter>program</parameter> was successful, and
                    <constant>GL_FALSE</constant>
                    otherwise.</para>
                </listitem>
            </varlistentry>

            <varlistentry>
                <term><constant>GL_INFO_LOG_LENGTH</constant></term>
                <listitem>
                    <para>
                    </para>
                    <para> <parameter>params</parameter> returns the
                    number of characters in the information log for
                    <parameter>program</parameter> including the null
                    termination character (i.e., the size of the
                    character buffer required to store the information
                    log). If <parameter>program</parameter> has no
                    information log, a value of 0 is
                    returned.</para>
                </listitem>
            </varlistentry>

            <varlistentry>
                <term><constant>GL_ATTACHED_SHADERS</constant></term>
                <listitem>
                    <para>
                    </para>
                    <para> <parameter>params</parameter> returns the
                    number of shader objects attached to
                    <parameter>program</parameter>.</para>
                </listitem>
            </varlistentry>

            <varlistentry>
                <term><constant>GL_ACTIVE_ATTRIBUTES</constant></term>
                <listitem>
                    <para>
                    </para>
                    <para> <parameter>params</parameter> returns the
                    number of active attribute variables for
                    <parameter>program</parameter>.</para>
                </listitem>
            </varlistentry>

            <varlistentry>
                <term><constant>GL_ACTIVE_ATTRIBUTE_MAX_LENGTH</constant></term>
                <listitem>
                    <para>
                    </para>
                    <para> <parameter>params</parameter> returns the
                    length of the longest active attribute name for
                    <parameter>program</parameter>, including the null
                    termination character (i.e., the size of the
                    character buffer required to store the longest
                    attribute name). If no active attributes exist, 0 is
                    returned.</para>
                </listitem>
            </varlistentry>

            <varlistentry>
                <term><constant>GL_ACTIVE_UNIFORMS</constant></term>
                <listitem>
                    <para>
                    </para>
                    <para> <parameter>params</parameter> returns the
                    number of active uniform variables for
                    <parameter>program</parameter>.</para>
                </listitem>
            </varlistentry>

            <varlistentry>
                <term><constant>GL_ACTIVE_UNIFORM_MAX_LENGTH</constant></term>
                <listitem>
                    <para>
                    </para>
                    <para> <parameter>params</parameter> returns the
                    length of the longest active uniform variable name
                    for <parameter>program</parameter>, including the
                    null termination character (i.e., the size of the
                    character buffer required to store the longest
                    uniform variable name). If no active uniform
                    variables exist, 0 is returned.</para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsect1>
    <refsect1 id="notes"><title>Notes</title>
        <para><function>glGetProgram</function> is available only if the
        GL version is 2.0 or greater.</para>

        <para>If an error is generated, no change is made to the
        contents of <parameter>params</parameter>.</para>
    </refsect1>
    <refsect1 id="errors"><title>Errors</title>
        <para><constant>GL_INVALID_VALUE</constant>
        is generated if <parameter>program</parameter>
        is not a value generated by OpenGL.</para>

        <para><constant>GL_INVALID_OPERATION</constant>
        is generated if <parameter>program</parameter>
        does not refer to a program object.</para>

        <para><constant>GL_INVALID_ENUM</constant>
        is generated if <parameter>pname</parameter>
        is not an accepted value.</para>

        <para><constant>GL_INVALID_OPERATION</constant> is generated if
        <function>glGetProgram</function> is executed between the
        execution of
        <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>
        and the corresponding execution of
        <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.</para>
    </refsect1>
    <refsect1 id="associatedgets"><title>Associated Gets</title>
        <para><citerefentry><refentrytitle>glGetActiveAttrib</refentrytitle></citerefentry>
        with argument <parameter>program</parameter></para>

        <para><citerefentry><refentrytitle>glGetActiveUniform</refentrytitle></citerefentry>
        with argument <parameter>program</parameter></para>

        <para><citerefentry><refentrytitle>glGetAttachedShaders</refentrytitle></citerefentry>
        with argument <parameter>program</parameter></para>

        <para><citerefentry><refentrytitle>glGetProgramInfoLog</refentrytitle></citerefentry>
        with argument <parameter>program</parameter></para>

        <para><citerefentry><refentrytitle>glIsProgram</refentrytitle></citerefentry>
        <parameter></parameter></para>
    </refsect1>
    <refsect1 id="seealso"><title>See Also</title>
        <para><citerefentry><refentrytitle>glAttachShader</refentrytitle></citerefentry>,
        <citerefentry><refentrytitle>glCreateProgram</refentrytitle></citerefentry>,
        <citerefentry><refentrytitle>glDeleteProgram</refentrytitle></citerefentry>,
        <citerefentry><refentrytitle>glGetShader</refentrytitle></citerefentry>,
        <citerefentry><refentrytitle>glLinkProgram</refentrytitle></citerefentry>,
        <citerefentry><refentrytitle>glValidateProgram</refentrytitle></citerefentry></para>
    </refsect1>
    <refsect1 id="Copyright"><title>Copyright</title>
        <para>
            Copyright <trademark class="copyright"></trademark> 2003-2005 3Dlabs Inc. Ltd.
            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>