Commit | Line | Data |
---|---|---|
7faf1d71 AW |
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd"> |
2 | <!-- saved from url=(0013)about:internet --> | |
3 | <?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> | |
4 | Specify new red, green, and blue values for the current secondary color. | |
5 | </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> | |
6 | Specifies a pointer to an array that contains red, green, blue. | |
7 | </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p> | |
8 | The GL stores both a primary four-valued RGBA color and a | |
9 | secondary four-valued RGBA color (where alpha is always set to 0.0) that is | |
10 | associated with every vertex. | |
11 | </p><p> | |
12 | The secondary color is interpolated and applied to each fragment during | |
13 | rasterization when <code class="constant">GL_COLOR_SUM</code> is enabled. When lighting is enabled, | |
14 | and <code class="constant">GL_SEPARATE_SPECULAR_COLOR</code> is specified, the value of the | |
15 | secondary color is assigned the value computed from the specular term of | |
16 | the lighting computation. Both the primary and secondary current colors are | |
17 | applied to each fragment, regardless of the state of <code class="constant">GL_COLOR_SUM</code>, | |
18 | under such conditions. When <code class="constant">GL_SEPARATE_SPECULAR_COLOR</code> is specified, | |
19 | the value returned from querying the current secondary color is undefined. | |
20 | </p><p> | |
21 | <code class="function">glSecondaryColor3b</code>, <code class="function">glSecondaryColor3s</code>, and | |
22 | <code class="function">glSecondaryColor3i</code> take three signed byte, short, or long integers as | |
23 | arguments. When <span class="bold"><strong>v</strong></span> is appended to the name, the color commands can | |
24 | take a pointer to an array of such values. | |
25 | </p><p> | |
26 | Color values are stored in floating-point format, with | |
27 | unspecified mantissa and exponent sizes. Unsigned integer color | |
28 | components, when specified, are linearly mapped to floating-point values | |
29 | such that the largest representable value maps to 1.0 (full intensity), and | |
30 | 0 maps to 0.0 (zero intensity). Signed integer color components, when | |
31 | specified, are linearly mapped to floating-point values such that the most | |
32 | positive representable value maps to 1.0, and the most negative | |
33 | representable value maps to | |
34 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
35 | ||
36 | <mml:mn>-1.0</mml:mn> | |
37 | </mml:math>. | |
38 | (Note that this mapping does not convert | |
39 | 0 precisely to 0.0). Floating-point values are mapped directly. | |
40 | </p><p> | |
41 | Neither floating-point nor signed integer values are clamped to the range | |
42 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
43 | ||
44 | <mml:mfenced open="[" close="]"> | |
45 | <mml:mn>0</mml:mn> | |
46 | <mml:mn>1</mml:mn> | |
47 | </mml:mfenced> | |
48 | </mml:math> | |
49 | before the current color is updated. However, color components are | |
50 | clamped to this range before they are interpolated or written into a color | |
51 | buffer. | |
52 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p> | |
53 | <code class="function">glSecondaryColor</code> is available only if the GL version is 1.4 or greater. | |
54 | </p><p> | |
55 | The initial value for the secondary color is (0, 0, 0, 0). | |
56 | </p><p> | |
57 | The secondary color can be updated at any time. In particular, <code class="function">glSecondaryColor</code> can | |
58 | 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 | |
59 | <a class="citerefentry" href="glEnd.xml"><span class="citerefentry"><span class="refentrytitle">glEnd</span></span></a>. | |
60 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="associatedgets"></a><h2>Associated Gets</h2><p> | |
61 | <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> | |
62 | </p><p> | |
63 | <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> | |
64 | </p><p> | |
65 | <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> | |
66 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p> | |
67 | <a class="citerefentry" href="glColor.xml"><span class="citerefentry"><span class="refentrytitle">glColor</span></span></a>, | |
68 | <a class="citerefentry" href="glIndex.xml"><span class="citerefentry"><span class="refentrytitle">glIndex</span></span></a>, | |
69 | <a class="citerefentry" href="glIsEnabled.xml"><span class="citerefentry"><span class="refentrytitle">glIsEnabled</span></span></a>, | |
70 | <a class="citerefentry" href="glLightModel.xml"><span class="citerefentry"><span class="refentrytitle">glLightModel</span></span></a>, | |
71 | <code class="function">glSecondaryColorPointer</code> | |
72 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p> | |
73 | Copyright <span class="trademark"></span>© 1991-2006 | |
74 | Silicon Graphics, Inc. This document is licensed under the SGI | |
75 | Free Software B License. For details, see | |
76 | <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>. | |
77 | </p></div></div></body></html> |