[info-performer] Why does second call to pfFrame crash this small test program

Date view Thread view Subject view Author view

From: Jonathan Kelly (Jonathan.Kelly++at++vrsim.net)
Date: 05/05/2005 14:35:18


I wrote a very small test program to debug why a second call to pfFrame
would crash the program. All I'm doing is opening up a window and attaching
a camera to it. I call pfFrame and pfSync after I open the window to display
the window then while in the sim loop I make a call to pfFrame and pfSync.
The catch comes when I make the call to pfFrame in the sim loop. Here is the
small test app that I wrote, where could I be going wrong???

Jonathan

#include <Performer/pf.h>
#include <Performer/pf/pfPipe.h>
#include <Performer/pf/pfScene.h>
#include <Performer/pf/pfPipeWindow.h>
#include <Performer/pf/pfChannel.h>

int main(int argc, char *argv[])
{
        pfPipe *pipe;
        pfPipeWindow *pw;
        pfScene *scene;

        /* Initialize Performer */
        pfInit();

        pfMultiprocess(PFMP_APPCULLDRAW);

        /* Configure */
        pfConfig();

        scene = new pfScene();

        /* Configure and open GL window */

        pipe = pfGetPipe(0);

        pw = new pfPipeWindow(pipe);

        pw->setName("OpenGL Performer");

        // set the size and origin of the pipe window
        pw->setOriginSize(0, 0, 800, 600);
        pw->open(); // open the new window

        pfFrame();
        pfSync();

        pfPipe *pCameraPipe = pfGetPipe(0);
        pfChannel *pChannel = new pfChannel(pCameraPipe); // create a camera from
the first pipe

        // sim loop
        for(;;)
        {
                pfFrame();
                pfSync();
        }

        pfExit();
        exit(0);
}


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Thu May 05 2005 - 14:32:49 PDT