<!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>glWindowPos</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="glWindowPos"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glWindowPos — specify the raster position in window coordinates for pixel operations</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">glWindowPos2s</b>(</code></td><td>GLshort  </td><td><var class="pdparam">x</var>, </td></tr><tr><td> </td><td>GLshort  </td><td><var class="pdparam">y</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">glWindowPos2i</b>(</code></td><td>GLint  </td><td><var class="pdparam">x</var>, </td></tr><tr><td> </td><td>GLint  </td><td><var class="pdparam">y</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">glWindowPos2f</b>(</code></td><td>GLfloat  </td><td><var class="pdparam">x</var>, </td></tr><tr><td> </td><td>GLfloat  </td><td><var class="pdparam">y</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">glWindowPos2d</b>(</code></td><td>GLdouble  </td><td><var class="pdparam">x</var>, </td></tr><tr><td> </td><td>GLdouble  </td><td><var class="pdparam">y</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">glWindowPos3s</b>(</code></td><td>GLshort  </td><td><var class="pdparam">x</var>, </td></tr><tr><td> </td><td>GLshort  </td><td><var class="pdparam">y</var>, </td></tr><tr><td> </td><td>GLshort  </td><td><var class="pdparam">z</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">glWindowPos3i</b>(</code></td><td>GLint  </td><td><var class="pdparam">x</var>, </td></tr><tr><td> </td><td>GLint  </td><td><var class="pdparam">y</var>, </td></tr><tr><td> </td><td>GLint  </td><td><var class="pdparam">z</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">glWindowPos3f</b>(</code></td><td>GLfloat  </td><td><var class="pdparam">x</var>, </td></tr><tr><td> </td><td>GLfloat  </td><td><var class="pdparam">y</var>, </td></tr><tr><td> </td><td>GLfloat  </td><td><var class="pdparam">z</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">glWindowPos3d</b>(</code></td><td>GLdouble  </td><td><var class="pdparam">x</var>, </td></tr><tr><td> </td><td>GLdouble  </td><td><var class="pdparam">y</var>, </td></tr><tr><td> </td><td>GLdouble  </td><td><var class="pdparam">z</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>x</code></em>, </span><span class="term"><em class="parameter"><code>y</code></em>, </span><span class="term"><em class="parameter"><code>z</code></em></span></dt><dd><p>
                    Specify the 
                    <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">x</mml:mi></mml:math>,
                    <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">y</mml:mi></mml:math>,
                    <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">z</mml:mi></mml:math>
                    coordinates for the raster position.
                </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">glWindowPos2sv</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">glWindowPos2iv</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">glWindowPos2fv</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">glWindowPos2dv</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">glWindowPos3sv</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">glWindowPos3iv</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">glWindowPos3fv</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">glWindowPos3dv</b>(</code></td><td>const GLdouble *  </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 of two or three elements,
                    specifying 
                    <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">x</mml:mi></mml:math>,
                    <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">y</mml:mi></mml:math>,
                    <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">z</mml:mi></mml:math>
                    coordinates, respectively.
                </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p>
            The GL maintains a 3D position in window coordinates.  This position,
            called the raster position, is used to position pixel and bitmap write
            operations. It is maintained with subpixel accuracy.  See <a class="citerefentry" href="glBitmap.xml"><span class="citerefentry"><span class="refentrytitle">glBitmap</span></span></a>,
            <a class="citerefentry" href="glDrawPixels.xml"><span class="citerefentry"><span class="refentrytitle">glDrawPixels</span></span></a>, and <a class="citerefentry" href="glCopyPixels.xml"><span class="citerefentry"><span class="refentrytitle">glCopyPixels</span></span></a>.
        </p><p>
            <code class="function">glWindowPos2</code> specifies the 
            <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">x</mml:mi></mml:math>
            and 
            <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">y</mml:mi></mml:math>
            coordinates, while 
            <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">z</mml:mi></mml:math>
            is
            implicitly set to 0.  <code class="function">glWindowPos3</code> specifies all three coordinates.
            The 
            <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">w</mml:mi></mml:math>
            coordinate of the current raster position is always set to 1.0.
        </p><p>
            <code class="function">glWindowPos</code> directly updates the 
            <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">x</mml:mi></mml:math>
            and 
            <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">y</mml:mi></mml:math>
            coordinates of the current raster
            position with the values specified.  That is, the values are neither
            transformed by the current modelview and projection matrices, nor by
            the viewport-to-window transform.  The 
            <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">z</mml:mi></mml:math>
            coordinate of the current raster
            position is updated in the following manner:
        </p><p>
            </p><div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
                
                <mml:mrow>
                    <mml:mi mathvariant="italic">z</mml:mi>
                    <mml:mo>=</mml:mo>
                    <mml:mfenced open="{" close="">
                        <mml:mrow>
                            <mml:mtable>
                                <mml:mtr><mml:mtd>
                                    <mml:mi mathvariant="italic">n</mml:mi>
                                </mml:mtd></mml:mtr>
                                <mml:mtr><mml:mtd>
                                    <mml:mi mathvariant="italic">f</mml:mi>
                                </mml:mtd></mml:mtr>
                                <mml:mtr><mml:mtd>
                                    <mml:mfenced open="" close="">
                                        <mml:mrow>
                                            <mml:mi mathvariant="italic">n</mml:mi>
                                            <mml:mo>+</mml:mo>
                                            <mml:mrow>
                                                <mml:mi mathvariant="italic">z</mml:mi>
                                                <mml:mo>×</mml:mo>
                                                <mml:mfenced open="(" close=")">
                                                    <mml:mrow>
                                                        <mml:mi mathvariant="italic">f</mml:mi>
                                                        <mml:mo>-</mml:mo>
                                                        <mml:mi mathvariant="italic">n</mml:mi>
                                                    </mml:mrow>
                                                </mml:mfenced>
                                            </mml:mrow>
                                        </mml:mrow>
                                    </mml:mfenced>
                                </mml:mtd></mml:mtr>
                            </mml:mtable>
                            <mml:mo>⁢</mml:mo>
                            <mml:mtable>
                                <mml:mtr><mml:mtd>
                                    <mml:mrow>
                                        <mml:mrow>
                                            <mml:mi mathvariant="italic">if</mml:mi>
                                            <mml:mo>⁢</mml:mo>
                                            <mml:mi mathvariant="italic">z</mml:mi>
                                        </mml:mrow>
                                        <mml:mo>&lt;=</mml:mo>
                                        <mml:mn>0</mml:mn>
                                    </mml:mrow>
                                </mml:mtd></mml:mtr>
                                <mml:mtr><mml:mtd>
                                    <mml:mrow>
                                        <mml:mrow>
                                            <mml:mi mathvariant="italic">if</mml:mi>
                                            <mml:mo>⁢</mml:mo>
                                            <mml:mi mathvariant="italic">z</mml:mi>
                                        </mml:mrow>
                                        <mml:mo>&gt;=</mml:mo>
                                        <mml:mn>1</mml:mn>
                                    </mml:mrow>
                                </mml:mtd></mml:mtr>
                                <mml:mtr><mml:mtd>
                                    <mml:mfenced open="" close="">
                                        <mml:mi mathvariant="normal">otherwise</mml:mi>
                                    </mml:mfenced>
                                </mml:mtd></mml:mtr>
                            </mml:mtable>
                        </mml:mrow>
                    </mml:mfenced>
                </mml:mrow>
            </mml:math></div><p>
        </p><p>
        </p><p>
            where 
            <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">n</mml:mi></mml:math>
            is <code class="constant">GL_DEPTH_RANGE</code>'s near value, and 
            <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">f</mml:mi></mml:math>
            is
            <code class="constant">GL_DEPTH_RANGE</code>'s far value.  See <a class="citerefentry" href="glDepthRange.xml"><span class="citerefentry"><span class="refentrytitle">glDepthRange</span></span></a>.
        </p><p>
            The specified coordinates are not clip-tested, causing the raster position
            to always be valid.
        </p><p>
            The current raster position also includes some associated color data and
            texture coordinates.  If lighting is enabled, then
            <code class="constant">GL_CURRENT_RASTER_COLOR</code> (in RGBA mode) or <code class="constant">GL_CURRENT_RASTER_INDEX</code>
            (in color index mode) is set to the color produced by the lighting
            calculation (see <a class="citerefentry" href="glLight.xml"><span class="citerefentry"><span class="refentrytitle">glLight</span></span></a>, <a class="citerefentry" href="glLightModel.xml"><span class="citerefentry"><span class="refentrytitle">glLightModel</span></span></a>, and <a class="citerefentry" href="glShadeModel.xml"><span class="citerefentry"><span class="refentrytitle">glShadeModel</span></span></a>).
            If lighting is disabled, current color (in RGBA mode, state variable
            <code class="constant">GL_CURRENT_COLOR</code>) or color index (in color index mode, state variable
            <code class="constant">GL_CURRENT_INDEX</code>) is used to update the current raster color.
            <code class="constant">GL_CURRENT_RASTER_SECONDARY_COLOR</code> (in RGBA mode) is likewise updated.
        </p><p>
            Likewise, <code class="constant">GL_CURRENT_RASTER_TEXTURE_COORDS</code> is updated as a function of
            <code class="constant">GL_CURRENT_TEXTURE_COORDS</code>, based on the texture matrix and the texture
            generation functions (see <a class="citerefentry" href="glTexGen.xml"><span class="citerefentry"><span class="refentrytitle">glTexGen</span></span></a>).  The
            <code class="constant">GL_CURRENT_RASTER_DISTANCE</code> is set to the <code class="constant">GL_CURRENT_FOG_COORD</code>.
        </p><p>
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p>
            <code class="function">glWindowPos</code> is available only if the GL version is 1.4 or greater.
        </p><p>
            The raster position is modified by <a class="citerefentry" href="glRasterPos.xml"><span class="citerefentry"><span class="refentrytitle">glRasterPos</span></span></a>, <a class="citerefentry" href="glBitmap.xml"><span class="citerefentry"><span class="refentrytitle">glBitmap</span></span></a>, and
            <code class="function">glWindowPos</code>.
        </p><p>
            Calling <a class="citerefentry" href="glDrawElements.xml"><span class="citerefentry"><span class="refentrytitle">glDrawElements</span></span></a>, or <a class="citerefentry" href="glDrawRangeElements.xml"><span class="citerefentry"><span class="refentrytitle">glDrawRangeElements</span></span></a> may leave the
            current color or index indeterminate.
            If <code class="function">glWindowPos</code> is executed while the current color or index is indeterminate, the
            current raster color or current raster index remains indeterminate.
        </p><p>
            There are distinct raster texture coordinates for each texture unit. Each
            texture unit's current raster texture coordinates are updated by <code class="function">glWindowPos</code>.
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p>
            <code class="constant">GL_INVALID_OPERATION</code> is generated if <code class="function">glWindowPos</code>
            is executed between the execution of <a class="citerefentry" href="glBegin.xml"><span class="citerefentry"><span class="refentrytitle">glBegin</span></span></a>
            and the corresponding execution of <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_RASTER_POSITION</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_CURRENT_RASTER_POSITION_VALID</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_CURRENT_RASTER_DISTANCE</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_CURRENT_RASTER_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_CURRENT_RASTER_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_CURRENT_RASTER_INDEX</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_CURRENT_RASTER_TEXTURE_COORDS</code>
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p>
            <a class="citerefentry" href="glBitmap.xml"><span class="citerefentry"><span class="refentrytitle">glBitmap</span></span></a>,
            <a class="citerefentry" href="glCopyPixels.xml"><span class="citerefentry"><span class="refentrytitle">glCopyPixels</span></span></a>,
            <a class="citerefentry" href="glDrawArrays.xml"><span class="citerefentry"><span class="refentrytitle">glDrawArrays</span></span></a>,
            <a class="citerefentry" href="glDrawElements.xml"><span class="citerefentry"><span class="refentrytitle">glDrawElements</span></span></a>,
            <a class="citerefentry" href="glDrawRangeElements.xml"><span class="citerefentry"><span class="refentrytitle">glDrawRangeElements</span></span></a>,
            <a class="citerefentry" href="glDrawPixels.xml"><span class="citerefentry"><span class="refentrytitle">glDrawPixels</span></span></a>,
            <a class="citerefentry" href="glMultiTexCoord.xml"><span class="citerefentry"><span class="refentrytitle">glMultiTexCoord</span></span></a>,
            <a class="citerefentry" href="glRasterPos.xml"><span class="citerefentry"><span class="refentrytitle">glRasterPos</span></span></a>,
            <a class="citerefentry" href="glTexCoord.xml"><span class="citerefentry"><span class="refentrytitle">glTexCoord</span></span></a>,
            <a class="citerefentry" href="glTexGen.xml"><span class="citerefentry"><span class="refentrytitle">glTexGen</span></span></a>,
            <a class="citerefentry" href="glVertex.xml"><span class="citerefentry"><span class="refentrytitle">glVertex</span></span></a>
        </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>
