<?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="gluBeginSurface">
    <refmeta>
        <refmetainfo>
            <copyright>
                <year>1991-2006</year>
                <holder>Silicon Graphics, Inc.</holder>
            </copyright>
        </refmetainfo>
        <refentrytitle>gluBeginSurface</refentrytitle>
        <manvolnum>3G</manvolnum>
    </refmeta>
    <refnamediv>
        <refname>gluBeginSurface</refname>
        <refpurpose>delimit a NURBS surface definition</refpurpose>
    </refnamediv>
    <refsynopsisdiv><title>C Specification</title>
        <funcsynopsis>
            <funcprototype>
                <funcdef>void <function>gluBeginSurface</function></funcdef>
                <paramdef>GLUnurbs* <parameter>nurb</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>
    <refsynopsisdiv><title>C Specification</title>
        <funcsynopsis>
            <funcprototype>
                <funcdef>void <function>gluEndSurface</function></funcdef>
                <paramdef>GLUnurbs* <parameter>nurb</parameter></paramdef>
            </funcprototype>
        </funcsynopsis>
    </refsynopsisdiv>
    <!-- eqn: ignoring delim $$ -->
    <refsect1 id="parameters"><title>Parameters</title>
        <variablelist>
        <varlistentry>
            <term><parameter>nurb</parameter></term>
            <listitem>
                <para>
                    Specifies the NURBS object (created with <citerefentry><refentrytitle>gluNewNurbsRenderer</refentrytitle></citerefentry>).
                </para>
            </listitem>
        </varlistentry>
        </variablelist>
    </refsect1>
    <refsect1 id="description"><title>Description</title>
        <para>
            Use <function>gluBeginSurface</function> to mark the beginning of a NURBS 
            surface definition. After 
            calling <function>gluBeginSurface</function>, make one or more calls to
            <citerefentry><refentrytitle>gluNurbsSurface</refentrytitle></citerefentry> to define the attributes of the surface.
            Exactly one of these calls to <citerefentry><refentrytitle>gluNurbsSurface</refentrytitle></citerefentry> must have a
            surface type of <constant>GLU_MAP2_VERTEX_3</constant> or <constant>GLU_MAP2_VERTEX_4</constant>.
            To mark the end of the NURBS surface definition, call
            <citerefentry><refentrytitle>gluEndSurface</refentrytitle></citerefentry>.
        </para>
        <para>
            Trimming of NURBS surfaces is supported with <citerefentry><refentrytitle>gluBeginTrim</refentrytitle></citerefentry>, 
            <citerefentry><refentrytitle>gluPwlCurve</refentrytitle></citerefentry>, <citerefentry><refentrytitle>gluNurbsCurve</refentrytitle></citerefentry>, and <citerefentry><refentrytitle>gluEndTrim</refentrytitle></citerefentry>. See the
            <citerefentry><refentrytitle>gluBeginTrim</refentrytitle></citerefentry> reference page for details.
        </para>
        <para>
            GL evaluators are used to render the NURBS surface as a set of polygons.
            Evaluator state is preserved during rendering
            with <citerefentry><refentrytitle>glPushAttrib</refentrytitle></citerefentry>(<constant>GLU_EVAL_BIT</constant>) and 
            <citerefentry><refentrytitle>glPopAttrib</refentrytitle></citerefentry>.  
            See the <citerefentry><refentrytitle>glPushAttrib</refentrytitle></citerefentry> reference page for details on exactly what state
            these calls preserve.
        </para>
    </refsect1>
    <refsect1 id="example"><title>Example</title>
        <para>
            The following commands render a textured NURBS surface with normals;
            the texture coordinates and normals are also described as NURBS surfaces:
            <programlisting>
gluBeginSurface(nobj);
   gluNurbsSurface(nobj, ..., GL_MAP2_TEXTURE_COORD_2);
   gluNurbsSurface(nobj, ..., GL_MAP2_NORMAL);
   gluNurbsSurface(nobj, ..., GL_MAP2_VERTEX_4);
gluEndSurface(nobj);
            </programlisting>
        </para>
    </refsect1>
    <refsect1 id="seealso"><title>See Also</title>
        <para>
            <citerefentry><refentrytitle>gluBeginCurve</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>gluBeginTrim</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>gluNewNurbsRenderer</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>gluNurbsCurve</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>gluNurbsSurface</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>gluPwlCurve</refentrytitle></citerefentry>,
            <citerefentry><refentrytitle>glPushAttrib</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>
