<!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.73.2" /></head><body><div class="refentry" lang="en" xml:lang="en"><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" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glSecondaryColor3b</b>(</code></td><td>GLbyte  </td><td><var class="pdparam">red</var>, </td></tr><tr><td> </td><td>GLbyte  </td><td><var class="pdparam">green</var>, </td></tr><tr><td> </td><td>GLbyte  </td><td><var class="pdparam">blue</var><code>)</code>;</td></tr></table></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glSecondaryColor3s</b>(</code></td><td>GLshort  </td><td><var class="pdparam">red</var>, </td></tr><tr><td> </td><td>GLshort  </td><td><var class="pdparam">green</var>, </td></tr><tr><td> </td><td>GLshort  </td><td><var class="pdparam">blue</var><code>)</code>;</td></tr></table></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glSecondaryColor3i</b>(</code></td><td>GLint  </td><td><var class="pdparam">red</var>, </td></tr><tr><td> </td><td>GLint  </td><td><var class="pdparam">green</var>, </td></tr><tr><td> </td><td>GLint  </td><td><var class="pdparam">blue</var><code>)</code>;</td></tr></table></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glSecondaryColor3f</b>(</code></td><td>GLfloat  </td><td><var class="pdparam">red</var>, </td></tr><tr><td> </td><td>GLfloat  </td><td><var class="pdparam">green</var>, </td></tr><tr><td> </td><td>GLfloat  </td><td><var class="pdparam">blue</var><code>)</code>;</td></tr></table></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glSecondaryColor3d</b>(</code></td><td>GLdouble  </td><td><var class="pdparam">red</var>, </td></tr><tr><td> </td><td>GLdouble  </td><td><var class="pdparam">green</var>, </td></tr><tr><td> </td><td>GLdouble  </td><td><var class="pdparam">blue</var><code>)</code>;</td></tr></table></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glSecondaryColor3ub</b>(</code></td><td>GLubyte  </td><td><var class="pdparam">red</var>, </td></tr><tr><td> </td><td>GLubyte  </td><td><var class="pdparam">green</var>, </td></tr><tr><td> </td><td>GLubyte  </td><td><var class="pdparam">blue</var><code>)</code>;</td></tr></table></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glSecondaryColor3us</b>(</code></td><td>GLushort  </td><td><var class="pdparam">red</var>, </td></tr><tr><td> </td><td>GLushort  </td><td><var class="pdparam">green</var>, </td></tr><tr><td> </td><td>GLushort  </td><td><var class="pdparam">blue</var><code>)</code>;</td></tr></table></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glSecondaryColor3ui</b>(</code></td><td>GLuint  </td><td><var class="pdparam">red</var>, </td></tr><tr><td> </td><td>GLuint  </td><td><var class="pdparam">green</var>, </td></tr><tr><td> </td><td>GLuint  </td><td><var class="pdparam">blue</var><code>)</code>;</td></tr></table></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl><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" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glSecondaryColor3bv</b>(</code></td><td>const GLbyte *  </td><td><var class="pdparam">v</var><code>)</code>;</td></tr></table></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glSecondaryColor3sv</b>(</code></td><td>const GLshort *  </td><td><var class="pdparam">v</var><code>)</code>;</td></tr></table></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glSecondaryColor3iv</b>(</code></td><td>const GLint *  </td><td><var class="pdparam">v</var><code>)</code>;</td></tr></table></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glSecondaryColor3fv</b>(</code></td><td>const GLfloat *  </td><td><var class="pdparam">v</var><code>)</code>;</td></tr></table></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glSecondaryColor3dv</b>(</code></td><td>const GLdouble *  </td><td><var class="pdparam">v</var><code>)</code>;</td></tr></table></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glSecondaryColor3ubv</b>(</code></td><td>const GLubyte *  </td><td><var class="pdparam">v</var><code>)</code>;</td></tr></table></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glSecondaryColor3usv</b>(</code></td><td>const GLushort *  </td><td><var class="pdparam">v</var><code>)</code>;</td></tr></table></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glSecondaryColor3uiv</b>(</code></td><td>const GLuint *  </td><td><var class="pdparam">v</var><code>)</code>;</td></tr></table></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="parameters2"></a><h2>Parameters</h2><div class="variablelist"><dl><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" lang="en" xml:lang="en"><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" lang="en" xml:lang="en"><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" lang="en" xml:lang="en"><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" lang="en" xml:lang="en"><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" lang="en" xml:lang="en"><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>
