Overlay problems

New Message Reply Date view Thread view Subject view Author view

Andy Bailey (andrew++at++csunb0.leeds.ac.uk)
Thu, 15 Jul 1999 17:45:12 +0000


Hi,

I need some help on clarifying what I should be doing to get overlays
working. All I need to do is draw a red square in front of the viewer as
they travel through the scene. I have read the man pages and on-line
documents about pfPipeWindow and pfWindow but am a bit confused really.

The following code is what I am using for configuring the window

ViewState->pw = new pfPipeWindow(pfGetPipe(0));
ViewState->pw->setWinType(PFPWIN_TYPE_X);
ViewState->pw->setMode(PFWIN_HAS_OVERLAY, PF_ON);

pfWindow *overlay = new pfWindow();
overlay->setWinType(PFPWIN_TYPE_X | PFWIN_TYPE_OVERLAY);
static int OverlayAttrs[] = { PFFB_LEVEL, 1, PFFB_BUFFER_SIZE, 8, None,
};

if (!(overlay->chooseFBConfig(OverlayAttrs)))
   pfNotify(PFNFY_NOTICE, PFNFY_PRINT, "pfWindow::chooseFBConfig failed
for OVERLAY win");

ViewState->pw->setOverlayWin(overlay);

Is this correct? I am unclear about changing the mode for the pipewindow
in the draw callback though. Also, what would be the best way of drawing
the red square? I was thinking about just defining a new geoset with 4
coordinates and just drawing that, or would a texture be easier?

Do I need to setup a pfPWinList of pfWindows for the alternate
framebuffer configurations? The code in the man pages and on-line
documentation is unclear to me, as to whether I need to setup the
pfPWinList.

I would also like to ask what the draw callback should look like, in
terms of switching between the overlay and back to the normal graphics
and where drawing the red square fits in. I have tried quite a few
different approaches, and I can get the square to appear, but it is just
fixed where I specified the 4 coordinates and does not 'move with the
eyepoint', or it is simply not there at all.

thanks,
Andrew


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Thu Jul 15 1999 - 09:47:33 PDT

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