Re: HUD

New Message Reply Date view Thread view Subject view Author view

From: Scott Herod (herod++at++rtset.com)
Date: 01/27/2000 09:14:05


You need to do a couple of things. Create a draw callback for
the top, HUD channel and attach it similar to:

...
  HUD_chan->setTravFunc(PFTRAV_DRAW, ClearDrawChannel);
....

static void ClearDrawChannel (pfChannel *chan, void *) {
  pfVec4 clr = pfVec4( 0.0f, 0.0f, 0.0f, 0.0f );
  pfClear( PFCL_DEPTH, &clr );
  // invoke Performer draw-processing for this frame
  pfDraw();
}

Create the bottom channel first and if you must assign a
draw callback for it, make sure to call channel->clear()
for it. channel->clear() is not automatically called
when you make your own callback so in the above, the HUD
is drawn over the existing image. The line
pfClear( PFCL_DEPTH, &clr ) clears the depth buffer so that
you don't have to worry about collisions between channels.
I think that it is reasonably expensive to clear the buffer
so it may be better to set the front and rear clipping planes
of the two channels so that they don't overlap.

Scott

Anthony Bavuso wrote:
>
> Another question regarding Aqua's HUD.
>
> Is it possible instead of making the top overlapping channel transparent,
> could you make it so that it only draws what is in its scene and does not
> clear what the rear channel is outputting? For example make the overlapping
> channel's view-port the same size as the bottom channels. And then put a
> gauge in the top channel. I would like the gauge not to be transparent and
> I also do not want to clear the contents of the bottom channel. So the end
> result is a gauge pasted on the top of the rest of my scene.
>
> How would I go about doing this? Thanks.
>


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Thu Jan 27 2000 - 09:14:26 PST

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