GLU Tesselator

New Message Reply Date view Thread view Subject view Author view

From: Sakis Gaitatzes (gaitat++at++yahoo.com)
Date: 03/26/2002 05:08:24


PfHi!

I am trying to pass a GLUtesselator to a channel draw function but
the pointer being passed turns into NULL.
I was wondering if someone could help me.

pfThanks.

PS. I have tried this both on an Octane and Onyx2 with 6.5.9f and
performer 2.4

Here is a minimal program source:

#include <Performer/pf/pfChannel.h>

typedef struct
{
    int frameCount;
    GLUtesselator *tess;
}
PassData;

// Called from the DRAW process
static void
drawChan (pfChannel *chan, void *data)
{
    PassData *pass;

    pass = (PassData *) data;
    printf ("Frame count = %d\n", pass->frameCount);

    GLUtesselator *tess = pass->tess;
    if (tess != (GLUtesselator *) 0)
    {
        GLdouble value;

        gluGetTessProperty (tess, GLU_TESS_WINDING_RULE, &value);
        GLenum windingRule = value;

        gluGetTessProperty (tess, GLU_TESS_BOUNDARY_ONLY, &value);
        GLenum boundaryOnly = value;

        printf ("Using tesselator with boundary %d\n",
boundaryOnly);
        printf ("Using tesselator with winding %d\n",
windingRule);
    }
}

int
main (int argc, char *argv[])
{
    pfInit ();
    pfMultiprocess (PFMP_DEFAULT);
    pfConfig ();

    // Configure and open GL window
    pfPipe *p = pfGetPipe (0);

    pfPipeWindow *pw = new pfPipeWindow (p);
    pw->setWinType (PFPWIN_TYPE_X);
    pw->setOriginSize (0, 0, 100, 100);
    pw->open ();

    // Create and configure a pfChannel.
    pfChannel *chan = new pfChannel (p);

    PassData *pass = (PassData *) chan->allocChanData (sizeof
(PassData));
    pass->frameCount = 0;
    pass->tess = gluNewTess ();

    GLenum windingRule, boundaryOnly;
    GLdouble value;
    gluGetTessProperty (pass->tess, GLU_TESS_BOUNDARY_ONLY,
&value);
    boundaryOnly = value;
    printf ("Default tesselator boundary %d\n", boundaryOnly);
    gluGetTessProperty (pass->tess, GLU_TESS_WINDING_RULE,
&value);
    windingRule = value;
    printf ("Default tesselator winding %d\n", windingRule);

    gluTessProperty (pass->tess, GLU_TESS_BOUNDARY_ONLY, GL_TRUE);
    gluTessProperty (pass->tess, GLU_TESS_WINDING_RULE,
GLU_TESS_WINDING_NONZERO);
    gluGetTessProperty (pass->tess, GLU_TESS_BOUNDARY_ONLY,
&value);
    boundaryOnly = value;
    printf ("Initint tesselator boundary %d\n", boundaryOnly);
    gluGetTessProperty (pass->tess, GLU_TESS_WINDING_RULE,
&value);
    windingRule = value;
    printf ("Initint tesselator winding %d\n", windingRule);

    chan->setTravFunc (PFTRAV_DRAW, drawChan);

    while (1)
    {
        pass->frameCount = pfSync ();
        chan->passChanData ();

        pfFrame ();
    }

    pfExit ();

    return 0;
}

=====
Athanasios Gaitatzes (Saki)
e-mail: gaitat++at++yahoo.com
   url: http://www.virtuality.gr/

__________________________________________________
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Tue Mar 26 2002 - 05:08:37 PST

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.