re: ViewKit and Performer

New Message Reply Date view Thread view Subject view Author view

Louis Bolduc (louis++at++speech.iar.nrc.ca)
Thu, 21 Jul 94 10:50:26 EDT


Yo Mark!

I have not done precisely what you are asking for, but you might find the
following useful:

I wrote a C++ MOTIF program and I used a GLX window to render images with
Performer. The trick is you have to do all your Performer initalizations
*after* your X interface has been realized. (in my application, after XtRealize
Widget) so you can supply the window numbers to pfInitGLXGfx. I use a WorkProc
to do my animation stuff with Performer.

This is my open_pipeline routine:

static void open_pipeline ( pfPipe *p )

{
    Display *xDpy = XtDisplay ( glx_parent_widget );
    Window xWin = XtWindow ( glx_parent_widget );
    Window glWin;
    Window overWin;
    GLXconfig *config;

    if ( getgdesc ( GD_MULTISAMPLE ) > 0 ) {
        config = pfuGLXCreateWindow ( ( pfuXDisplay * ) xDpy,
                                      ( pfuXWindow ) xWin,
                                      border, border,
                                      width, height, 0,
                                      GLX_NORMAL, GLX_DOUBLE, TRUE,
                                      GLX_NORMAL, GLX_RGB, TRUE,
                                      GLX_NORMAL, GLX_ZSIZE, 0,
                                      GLX_NORMAL, GLX_STENSIZE, 0,
                                      GLX_NORMAL, GLX_MSSAMPLE, 8,
                                      GLX_NORMAL, GLX_MSZSIZE, 24,
                                      GLX_NORMAL, GLX_MSSSIZE, 1,
                                      GLX_OVERLAY, GLX_BUFSIZE, 2,
                                      0, 0, 0 );
    } else {
        config = pfuGLXCreateWindow ( ( pfuXDisplay * ) xDpy,
                                      ( pfuXWindow ) xWin,
                                      border, border,
                                      width, height, 0,
                                      GLX_NORMAL, GLX_DOUBLE, TRUE,
                                      GLX_NORMAL, GLX_RGB, TRUE,
                                      GLX_NORMAL, GLX_ZSIZE, GLX_NOCONFIG,
                                      GLX_NORMAL, GLX_STENSIZE, 1,
                                      GLX_OVERLAY, GLX_BUFSIZE, 2,
                                      0, 0, 0 );
    }

    glWin = GLXgetvalue ( config, GLX_NORMAL, GLX_WINDOW ),
    overWin = GLXgetvalue ( config, GLX_OVERLAY, GLX_WINDOW ),

    free ( config );

    pfInitGLXGfx ( p, ( void * ) xDpy, xWin, glWin, overWin, 0UL );

    pfApplyMtl ( pfNewMtl ( pfGetSharedArena () ) );
    pfApplyLModel ( pfNewLModel ( pfGetSharedArena () ) );
}

static unsigned long GLXgetvalue ( GLXconfig* conf, int buffer, int mode )

{
    int i;

    for ( i = 0; conf [ i ].buffer; i++ ) {
        if ( conf [ i ].buffer == buffer && conf [ i ].mode == mode ) {
            return conf [ i ].arg;
        }
    }

    return 0;
}


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:50:23 PDT

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