<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd"><!-- saved from url=(0013)about:internet -->
<?xml-stylesheet type="text/xsl" href="mathml.xsl"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:pref="http://www.w3.org/2002/Math/preference" pref:renderer="mathplayer-dl"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>glSecondaryColor</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1" /></head><body><div class="refentry"><a id="glSecondaryColor"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glSecondaryColor — set the current secondary color</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">void <strong class="fsfunc">glSecondaryColor3b</strong>(</code></td><td>GLbyte <var class="pdparam">red</var>, </td></tr><tr><td> </td><td>GLbyte <var class="pdparam">green</var>, </td></tr><tr><td> </td><td>GLbyte <var class="pdparam">blue</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">void <strong class="fsfunc">glSecondaryColor3s</strong>(</code></td><td>GLshort <var class="pdparam">red</var>, </td></tr><tr><td> </td><td>GLshort <var class="pdparam">green</var>, </td></tr><tr><td> </td><td>GLshort <var class="pdparam">blue</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">void <strong class="fsfunc">glSecondaryColor3i</strong>(</code></td><td>GLint <var class="pdparam">red</var>, </td></tr><tr><td> </td><td>GLint <var class="pdparam">green</var>, </td></tr><tr><td> </td><td>GLint <var class="pdparam">blue</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">void <strong class="fsfunc">glSecondaryColor3f</strong>(</code></td><td>GLfloat <var class="pdparam">red</var>, </td></tr><tr><td> </td><td>GLfloat <var class="pdparam">green</var>, </td></tr><tr><td> </td><td>GLfloat <var class="pdparam">blue</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">void <strong class="fsfunc">glSecondaryColor3d</strong>(</code></td><td>GLdouble <var class="pdparam">red</var>, </td></tr><tr><td> </td><td>GLdouble <var class="pdparam">green</var>, </td></tr><tr><td> </td><td>GLdouble <var class="pdparam">blue</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">void <strong class="fsfunc">glSecondaryColor3ub</strong>(</code></td><td>GLubyte <var class="pdparam">red</var>, </td></tr><tr><td> </td><td>GLubyte <var class="pdparam">green</var>, </td></tr><tr><td> </td><td>GLubyte <var class="pdparam">blue</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">void <strong class="fsfunc">glSecondaryColor3us</strong>(</code></td><td>GLushort <var class="pdparam">red</var>, </td></tr><tr><td> </td><td>GLushort <var class="pdparam">green</var>, </td></tr><tr><td> </td><td>GLushort <var class="pdparam">blue</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">void <strong class="fsfunc">glSecondaryColor3ui</strong>(</code></td><td>GLuint <var class="pdparam">red</var>, </td></tr><tr><td> </td><td>GLuint <var class="pdparam">green</var>, </td></tr><tr><td> </td><td>GLuint <var class="pdparam">blue</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>red</code></em>, </span><span class="term"><em class="parameter"><code>green</code></em>, </span><span class="term"><em class="parameter"><code>blue</code></em></span></dt><dd><p>
                    Specify new red, green, and blue values for the current secondary color.
                </p></dd></dl></div></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">void <strong class="fsfunc">glSecondaryColor3bv</strong>(</code></td><td>const GLbyte * <var class="pdparam">v</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">void <strong class="fsfunc">glSecondaryColor3sv</strong>(</code></td><td>const GLshort * <var class="pdparam">v</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">void <strong class="fsfunc">glSecondaryColor3iv</strong>(</code></td><td>const GLint * <var class="pdparam">v</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">void <strong class="fsfunc">glSecondaryColor3fv</strong>(</code></td><td>const GLfloat * <var class="pdparam">v</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">void <strong class="fsfunc">glSecondaryColor3dv</strong>(</code></td><td>const GLdouble * <var class="pdparam">v</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">void <strong class="fsfunc">glSecondaryColor3ubv</strong>(</code></td><td>const GLubyte * <var class="pdparam">v</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">void <strong class="fsfunc">glSecondaryColor3usv</strong>(</code></td><td>const GLushort * <var class="pdparam">v</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">void <strong class="fsfunc">glSecondaryColor3uiv</strong>(</code></td><td>const GLuint * <var class="pdparam">v</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a id="parameters2"></a><h2>Parameters</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>v</code></em></span></dt><dd><p>
                    Specifies a pointer to an array that contains red, green, blue.
                </p></dd></dl></div></div><div class="refsect1"><a id="description"></a><h2>Description</h2><p>
            The GL stores both a primary four-valued RGBA color and a
            secondary four-valued RGBA color (where alpha is always set to 0.0) that is
            associated with every vertex.
        </p><p>
            The secondary color is interpolated and applied to each fragment during
            rasterization when <code class="constant">GL_COLOR_SUM</code> is enabled.  When lighting is enabled,
            and <code class="constant">GL_SEPARATE_SPECULAR_COLOR</code> is specified, the value of the
            secondary color is assigned the value computed from the specular term of
            the lighting computation. Both the primary and secondary current colors are
            applied to each fragment, regardless of the state of <code class="constant">GL_COLOR_SUM</code>,
            under such conditions.  When <code class="constant">GL_SEPARATE_SPECULAR_COLOR</code> is specified,
            the value returned from querying the current secondary color is undefined.
        </p><p>
            <code class="function">glSecondaryColor3b</code>, <code class="function">glSecondaryColor3s</code>, and
            <code class="function">glSecondaryColor3i</code> take three signed byte, short, or long integers as
            arguments.  When <span class="bold"><strong>v</strong></span> is appended to the name, the color commands can
            take a pointer to an array of such values.
        </p><p>
            Color values are stored in floating-point format, with
            unspecified mantissa and exponent sizes.  Unsigned integer color
            components, when specified, are linearly mapped to floating-point values
            such that the largest representable value maps to 1.0 (full intensity), and
            0 maps to 0.0 (zero intensity).  Signed integer color components, when
            specified, are linearly mapped to floating-point values such that the most
            positive representable value maps to 1.0, and the most negative
            representable value maps to 
            <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
                
                <mml:mn>-1.0</mml:mn>
            </mml:math>.
            (Note that this mapping does not convert
            0 precisely to 0.0).  Floating-point values are mapped directly.
        </p><p>
            Neither floating-point nor signed integer values are clamped to the range
            <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
                
                <mml:mfenced open="[" close="]">
                    <mml:mn>0</mml:mn>
                    <mml:mn>1</mml:mn>
                </mml:mfenced>
            </mml:math>
            before the current color is updated.  However, color components are
            clamped to this range before they are interpolated or written into a color
            buffer.
        </p></div><div class="refsect1"><a id="notes"></a><h2>Notes</h2><p>
            <code class="function">glSecondaryColor</code> is available only if the GL version is 1.4 or greater.
        </p><p>
            The initial value for the secondary color is (0, 0, 0, 0).
        </p><p>
            The secondary color can be updated at any time.  In particular, <code class="function">glSecondaryColor</code> can
            be called between a call to <a class="citerefentry" href="glBegin.xml"><span class="citerefentry"><span class="refentrytitle">glBegin</span></span></a> and the corresponding call to
            <a class="citerefentry" href="glEnd.xml"><span class="citerefentry"><span class="refentrytitle">glEnd</span></span></a>.
        </p></div><div class="refsect1"><a id="associatedgets"></a><h2>Associated Gets</h2><p>
            <a class="citerefentry" href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_CURRENT_SECONDARY_COLOR</code>
        </p><p>
            <a class="citerefentry" href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_RGBA_MODE</code>
        </p><p>
            <a class="citerefentry" href="glIsEnabled.xml"><span class="citerefentry"><span class="refentrytitle">glIsEnabled</span></span></a> with argument <code class="constant">GL_COLOR_SUM</code>
        </p></div><div class="refsect1"><a id="seealso"></a><h2>See Also</h2><p>
            <a class="citerefentry" href="glColor.xml"><span class="citerefentry"><span class="refentrytitle">glColor</span></span></a>,
            <a class="citerefentry" href="glIndex.xml"><span class="citerefentry"><span class="refentrytitle">glIndex</span></span></a>,
            <a class="citerefentry" href="glIsEnabled.xml"><span class="citerefentry"><span class="refentrytitle">glIsEnabled</span></span></a>,
            <a class="citerefentry" href="glLightModel.xml"><span class="citerefentry"><span class="refentrytitle">glLightModel</span></span></a>,
            <code class="function">glSecondaryColorPointer</code>
        </p></div><div class="refsect1"><a id="Copyright"></a><h2>Copyright</h2><p>
            Copyright <span class="trademark"></span>© 1991-2006
            Silicon Graphics, Inc. This document is licensed under the SGI
            Free Software B License. For details, see
            <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>.
        </p></div></div></body></html>