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

Date view Thread view Subject view Author view

l.voerman++at++rc.rug.nl
Date: 05/09/2005 01:17:49


Jonathan,

Before starting the sim loop, add:
        pChannel->setScene(scene);
or remove
        pfChannel *pChannel = new pfChannel(pCameraPipe);

Laurens Voerman
Centre for High Performance Computing & Visualisation
University of Groningen
The Netherlands

email: l.voerman_at_rc.rug.nl
tel +31 50 363 9247

On 5 May 2005 at 17:35, Jonathan Kelly wrote:

> 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);
> }
>
> -----------------------------------------------------------------------
> List Archives, Info, FAQ: http://www.sgi.com/software/performer/
> Open Development Project: http://oss.sgi.com/projects/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
> -----------------------------------------------------------------------
>


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Mon May 09 2005 - 01:17:02 PDT