<?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="gluBeginPolygon">
    <refmeta>
        <refmetainfo>
            <copyright>
                <year>1991-2006</year>
                <holder>Silicon Graphics, Inc.</holder>
            </copyright>
        </refmetainfo>
        <refentrytitle>gluBeginPolygon</refentrytitle>
        <manvolnum>3G</manvolnum>
    </refmeta>
    <refnamediv>
        <refname>gluBeginPolygon</refname>
        <refpurpose>delimit a polygon description</refpurpose>
    </refnamediv>
    <refsynopsisdiv><title>C Specification</title>
        <funcsynopsis>
            <funcprototype>
                <funcdef>void <function>gluBeginPolygon</function></funcdef>
                <paramdef>GLUtesselator* <parameter>tess</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>
    <refsynopsisdiv><title>C Specification</title>
        <funcsynopsis>
            <funcprototype>
                <funcdef>void <function>gluEndPolygon</function></funcdef>
                <paramdef>GLUtesselator* <parameter>tess</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>
    <!-- eqn: ignoring delim $$ -->
    <refsect1 id="parameters"><title>Parameters</title>
        <variablelist>
        <varlistentry>
            <term><parameter>tess</parameter></term>
            <listitem>
                <para>
                    Specifies the tessellation object (created with <citerefentry><refentrytitle>gluNewTess</refentrytitle></citerefentry>).
                </para>
            </listitem>
        </varlistentry>
        </variablelist>
    </refsect1>
    <refsect1 id="description"><title>Description</title>
        <para>
            <function>gluBeginPolygon</function> and <citerefentry><refentrytitle>gluEndPolygon</refentrytitle></citerefentry> delimit the definition of a
            nonconvex polygon.
            To define such a polygon, first call <function>gluBeginPolygon</function>.
            Then define the contours of the polygon
            by calling 
            <citerefentry><refentrytitle>gluTessVertex</refentrytitle></citerefentry> for each vertex
            and <citerefentry><refentrytitle>gluNextContour</refentrytitle></citerefentry> to start each new contour.
            Finally, call <citerefentry><refentrytitle>gluEndPolygon</refentrytitle></citerefentry>
            to signal the end of the definition.
            See the <citerefentry><refentrytitle>gluTessVertex</refentrytitle></citerefentry> and 
            <citerefentry><refentrytitle>gluNextContour</refentrytitle></citerefentry> reference pages for more details.
        </para>
        <para>
            Once <citerefentry><refentrytitle>gluEndPolygon</refentrytitle></citerefentry> is called, the polygon is tessellated, and the
            resulting triangles are described through callbacks.
            See <citerefentry><refentrytitle>gluTessCallback</refentrytitle></citerefentry> for descriptions of the callback functions.
        </para>
    </refsect1>
    <refsect1 id="notes"><title>Notes</title>
        <para>
            This command is obsolete and is provided for backward compatibility
            only. Calls to <function>gluBeginPolygon</function> are mapped to 
            <citerefentry><refentrytitle>gluTessBeginPolygon</refentrytitle></citerefentry>
            followed by 
            <citerefentry><refentrytitle>gluTessBeginContour</refentrytitle></citerefentry>. Calls to <citerefentry><refentrytitle>gluEndPolygon</refentrytitle></citerefentry> are mapped
            to <citerefentry><refentrytitle>gluTessEndContour</refentrytitle></citerefentry> followed by <citerefentry><refentrytitle>gluTessEndPolygon</refentrytitle></citerefentry>.
        </para>
    </refsect1>
    <refsect1 id="example"><title>Example</title>
        <para>
            A quadrilateral with a triangular hole in it can be described like this:
            <programlisting>
gluBeginPolygon(tobj);
   gluTessVertex(tobj, v1, v1);
   gluTessVertex(tobj, v2, v2);
   gluTessVertex(tobj, v3, v3);
   gluTessVertex(tobj, v4, v4);
gluNextContour(tobj, GLU_INTERIOR);
   gluTessVertex(tobj, v5, v5);
   gluTessVertex(tobj, v6, v6);
   gluTessVertex(tobj, v7, v7);
gluEndPolygon(tobj);
            </programlisting>
        </para>
    </refsect1>
    <refsect1 id="seealso"><title>See Also</title>
        <para>
            <citerefentry><refentrytitle>gluNewTess</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>gluNextContour</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>gluTessBeginContour</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>gluTessBeginPolygon</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>gluTessCallback</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>gluTessVertex</refentrytitle></citerefentry>
        </para>
    </refsect1>
    <refsect1 id="Copyright"><title>Copyright</title>
        <para>
            Copyright <trademark class="copyright"></trademark> 1991-2006
            Silicon Graphics, Inc. This document is licensed under the SGI
            Free Software B License. For details, see
            <ulink url="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</ulink>.
        </para>
    </refsect1>
</refentry>
