<?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="gluTessBeginPolygon">
    <refmeta>
        <refmetainfo>
            <copyright>
                <year>1991-2006</year>
                <holder>Silicon Graphics, Inc.</holder>
            </copyright>
        </refmetainfo>
        <refentrytitle>gluTessBeginPolygon</refentrytitle>
        <manvolnum>3G</manvolnum>
    </refmeta>
    <refnamediv>
        <refname>gluTessBeginPolygon</refname>
        <refpurpose>delimit a polygon description</refpurpose>
    </refnamediv>
    <refsynopsisdiv><title>C Specification</title>
        <funcsynopsis>
            <funcprototype>
                <funcdef>void <function>gluTessBeginPolygon</function></funcdef>
                <paramdef>GLUtesselator* <parameter>tess</parameter></paramdef>
                <paramdef>GLvoid* <parameter>data</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>
        <varlistentry>
            <term><parameter>data</parameter></term>
            <listitem>
                <para>
                    Specifies a pointer to user polygon data.
                </para>
            </listitem>
        </varlistentry>
        </variablelist>
    </refsect1>
    <refsect1 id="description"><title>Description</title>
        <para>
            <function>gluTessBeginPolygon</function> and <citerefentry><refentrytitle>gluTessEndPolygon</refentrytitle></citerefentry> delimit the definition of a
            convex, concave or self-intersecting polygon. Within each <function>gluTessBeginPolygon</function>/<citerefentry><refentrytitle>gluTessEndPolygon</refentrytitle></citerefentry>
            pair, there must be one or more calls to <citerefentry><refentrytitle>gluTessBeginContour</refentrytitle></citerefentry>/<citerefentry><refentrytitle>gluTessEndContour</refentrytitle></citerefentry>. 
            Within each contour, there are zero or more calls to <citerefentry><refentrytitle>gluTessVertex</refentrytitle></citerefentry>. The vertices 
            specify a closed contour (the last vertex of each contour is automatically linked 
            to the first). See the <citerefentry><refentrytitle>gluTessVertex</refentrytitle></citerefentry>, <citerefentry><refentrytitle>gluTessBeginContour</refentrytitle></citerefentry>, and 
            <citerefentry><refentrytitle>gluTessEndContour</refentrytitle></citerefentry> reference pages for more details.
        </para>
        <para>
            <parameter>data</parameter> is a pointer to a user-defined data structure. If the appropriate callback(s) 
            are specified (see <citerefentry><refentrytitle>gluTessCallback</refentrytitle></citerefentry>), then this pointer is returned to the 
            callback function(s). Thus, it is a convenient way to store per-polygon information.
        </para>
        <para>
            Once <citerefentry><refentrytitle>gluTessEndPolygon</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="example"><title>Example</title>
        <para>
            A quadrilateral with a triangular hole in it can be described as follows:
            <programlisting>
gluTessBeginPolygon(tobj, NULL);
   gluTessBeginContour(tobj);
      gluTessVertex(tobj, v1, v1);
      gluTessVertex(tobj, v2, v2);
      gluTessVertex(tobj, v3, v3);
      gluTessVertex(tobj, v4, v4);
   gluTessEndContour(tobj);
   gluTessBeginContour(tobj);
      gluTessVertex(tobj, v5, v5);
      gluTessVertex(tobj, v6, v6);
      gluTessVertex(tobj, v7, v7);
   gluTessEndContour(tobj);
gluTessEndPolygon(tobj);
            </programlisting>
        </para>
        <para>
        </para>
    </refsect1>
    <refsect1 id="seealso"><title>See Also</title>
        <para>
            <citerefentry><refentrytitle>gluNewTess</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>gluTessBeginContour</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>gluTessCallback</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>gluTessEndPolygon</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>gluTessNormal</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>gluTessProperty</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>
