[info-performer] Multipipe Initialization

Date view Thread view Subject view Author view

From: Christopher D. Johnson (cubicwts++at++excite.com)
Date: 10/03/2005 11:31:41


Greetings all. I have a simulation program running on a dual processor PC. There is an upper and a lower LCD display, with the lower LCD being a touch screen. The lower screen is "display 0" while the upper screen is "display 1".

What I am trying unsuccessfully to do is initialize performer so that I have 2 pfPipes created (one for each display) and each pfPipe has just a single pfPipeWindow attached to it. Everything initializes seemingly fine until I call pfFrame() for the first time, at which time I see my full screen windows created (blank) on the uper and lower display, and then it bombs out (the screens disappear) and I get the following notice:

"PF Notice: pfChooseFBConfig: failed to make configuration matching specified attributes"

Below that I get a "BadWindow" message as my X calls try to operate on the lower window created. Simply going back to one pipe, one window runs fine. Here are the functions I am using to initialize performer and initialize the pfPipes and pfPipeWindows. I've looked in the Performer manual and tried to set the pipes and windows up to work properly, but obviously I am missing something. Any clues?

static void
initPerformer(void)
{
   void *arena = NULL;
   pfSharedArenaSize(134217728); /* 128 * 1024 * 1024 = 128 Mb */
   // pfSharedArenaSize(167772160); /* 160 * 1024 * 1024 = 128 Mb */
   // pfSharedArenaSize(268435456); /* 256 * 1024 * 1024 = 256 Mb */
   pfInit();
   arena = pfGetSharedArena();

   /* Allocate Global Variables */
   mttGlobal = pfMalloc(sizeof(global_t), arena);
   MttGfx = pfMalloc(sizeof( MTTGFX ), arena);
   c_ = pfMalloc(sizeof( struct ForCComm ), arena);
   ntReq = pfMalloc(sizeof(NTREQ), arena);

   Client = pfMalloc(sizeof( CLIENT ), arena);
   BBoxTerrain = pfMalloc(sizeof ( pfBox ), arena);

   /* initialize global values */
   initGlobal();

   /*------------------------------------------------------
    * Initialize main Gfx variables.
    *-----------------------------------------------------*/
   initGfx();
   readConfigFile();

   // pfMultiprocess(PFMP_DEFAULT);
   pfMultiprocess(PFMP_FORK_DBASE | PFMP_FORK_LPOINT);
   pfMultipipe(2);

   // scb - uncommented Multithread(...)
   /* pfMultithread(0, PFPROC_CULL, 2); */

   pfdInitConverter("flt");
   pfConfig();
   pfFilePath( "../data/");
   pfNotifyLevel(PFNFY_FATAL);
#ifdef GFXAUTOSYNC
   pfFrameRate(MttGfx->FrameRate);
   pfPhase(PFPHASE_LOCK);
#endif
}

static void OpenPipeWin(pfPipeWindow *pwin)
{
   pfOpenPWin(pwin);
}

static void
initPipeWindow(void)
{
   int constraints[] = {
      PFFB_DOUBLEBUFFER,
      PFFB_RGBA,
      PFFB_RED_SIZE, 5,
      PFFB_GREEN_SIZE, 5,
      PFFB_BLUE_SIZE, 5,

      PFFB_ALPHA_SIZE, 1,
      PFFB_STENCIL_SIZE, 8,
      PFFB_DEPTH_SIZE, 15,
      (int)NULL
   };
   /*------------------------------------------------------
    * Configure graphics pipeline.
    *-----------------------------------------------------*/
   mttGlobal->gfxPipeLOWER = pfGetPipe(0);
   if (!(mttGlobal->gfxPipeLOWER)) {
      fprintf(stderr, "ERROR: Unable to initialize (pfPipe *) LOWER!\n");
      abort();
   }
   mttGlobal->gfxPipeUPPER = pfGetPipe(1);
   if (!(mttGlobal->gfxPipeUPPER)) {
      fprintf(stderr, "ERROR: Unable to initialize (pfPipe *) UPPER!\n");
      abort();
   }
   
   pfPipeScreen(mttGlobal->gfxPipeLOWER,0);
   pfPipeScreen(mttGlobal->gfxPipeUPPER,1);
   
   mttGlobal->pwinLOWER = pfNewPWin(mttGlobal->gfxPipeLOWER);
   if (!(mttGlobal->pwinLOWER)) {
      fprintf(stderr, "ERROR: Unable to initialize (pfWindow *) LOWER!\n");
      abort();
   }
   mttGlobal->pwinUPPER = pfNewPWin(mttGlobal->gfxPipeUPPER);
   if (!(mttGlobal->pwinUPPER)) {
      fprintf(stderr, "ERROR: Unable to initialize (pfWindow *) UPPER!\n");
      abort();
   }
   
   pfPWinName(mttGlobal->pwinLOWER,MttGfx->ScreenLOWER.Name);
   pfPWinType(mttGlobal->pwinLOWER, PFWIN_TYPE_X);
   pfPWinMode( mttGlobal->pwinLOWER, PFWIN_NOBORDER, 1);
   pfPWinConfigFunc( mttGlobal->pwinLOWER, OpenPipeWin);
   pfChoosePWinFBConfig( mttGlobal->pwinLOWER, constraints);
   pfConfigPWin( mttGlobal->pwinLOWER );
   pfPWinOriginSize(mttGlobal->pwinLOWER, 0, 0,
      MttGfx->ScreenLOWER.SizeW,
      MttGfx->ScreenLOWER.SizeH);
   //pfPWinScreen(mttGlobal->pwinLOWER,0);
   pfOpenPWin(mttGlobal->pwinLOWER);
   
   pfPWinName(mttGlobal->pwinUPPER,MttGfx->ScreenUPPER.Name);
   pfPWinType(mttGlobal->pwinUPPER, PFWIN_TYPE_X);
   pfPWinMode( mttGlobal->pwinUPPER, PFWIN_NOBORDER, 1);
   pfPWinConfigFunc( mttGlobal->pwinUPPER, OpenPipeWin);
   pfChoosePWinFBConfig( mttGlobal->pwinUPPER, constraints);
   pfConfigPWin( mttGlobal->pwinUPPER );
   pfPWinOriginSize(mttGlobal->pwinUPPER, 0, 0,
      MttGfx->ScreenUPPER.SizeW,
      MttGfx->ScreenUPPER.SizeH);
   //pfPWinScreen(mttGlobal->pwinLOWER,1);
   pfOpenPWin(mttGlobal->pwinUPPER);
   
   /* set off the draw process to open windows and call init callbacks */
   pfFrame();

   sleep(3);
   
   pfPWinFullScreen( mttGlobal->pwinLOWER );
   pfPWinFullScreen( mttGlobal->pwinUPPER );
   
   mttGlobal->dspLOWER = pfGetCurWSConnection();

   // Logic To Set Up Catching Of X-Events on the lower touch screen
   mttGlobal->winLOWER = pfGetPWinWSWindow(mttGlobal->pwinLOWER);
   XSelectInput(mttGlobal->dspLOWER,mttGlobal->winLOWER,KeyPressMask | ButtonPressMask );
   XMapWindow(mttGlobal->dspLOWER,mttGlobal->winLOWER);
   XSync(mttGlobal->dspLOWER,FALSE);

   /*------------------------------------------------------
    * Remove cursor arrow.
    *-----------------------------------------------------*/
#ifndef TESTMTT
   pfuLoadPWinCursor(mttGlobal->pwinLOWER, PFU_CURSOR_OFF);
#endif
}

Christopher D. Johnson
AV-8B Harrier II Simulators
ISEO Support Team
Cherry Point, NC
252-466-4542
252-466-4538

_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Mon Oct 03 2005 - 11:32:07 PDT