From: Simon C Mills (simon++at++wgs.estec.esa.nl)
Date: 05/09/2001 00:59:13
Jason Coposky wrote:
>
> quick question:
>
> is there anyway to get a pfutil GUI panel ( ala perfly )
> to draw into both the back right and back left buffers?
> ive naturally tried the glDrawBuffer( GL_BACK_RIGHT );
> but im suspecting that Performer doesnt use opengl to draw
> the widgets, or it specifically sets the draw buffer in the
> default widget draw func.
Yeah, I've encountered this one - you want to draw the GUI panel in both
left and right eyes in a stereo application. This is what I did:
1) In your APP process override the default GUI cahnnel draw callback:
// Set up callback to draw GUI in both left & right buffers
pfChannel *guiChan = pfuGetGUIChan();
guiChan->setTravFunc(PFTRAV_DRAW, StereoDrawGUI);
2) In your draw process set up a custom callback that enables drawing
into BOTH left & right back buffers, then call the standard GUI draw
function:
static void
enableBothStereoBuffers(void)
{
// Enable writing to both left and right (back) stereo buffers
#ifdef IRISGL
leftbuffer(1);
rightbuffer(1);
#else /* OpenGL */
glDrawBuffer(GL_BACK);
#endif /* GL type */
}
void
StereoDrawGUI(pfChannel *chan, void *data) // Draw GUI in stereo
callback
{
// Draw GUI in both left & right buffers
enableBothStereoBuffers();
pfuDrawGUI(chan, data);
}
Hope it helps, Simon
_______________________________________________________________________
Simon Mills
Silicon Worlds S.A.
c/o Modelling & Simulation Section (TOS-EMM) Tel: +31 (0)71 565 3725
European Space Agency (ESA/ESTEC) Fax: +31 (0)71 565 5419
Postbus 299, 2200AG Noordwijk e-mail: simon++at++wgs.estec.esa.nl
The Netherlands http://www.estec.esa.nl/wmwww/EMM
_______________________________________________________________________
This archive was generated by hypermail 2b29 : Wed May 09 2001 - 00:54:15 PDT