Bryan Wasileski (bwasileski++at++mdc.com)
Fri, 06 Dec 1996 06:27:33 -0600
for(i=0;i<num_targets;i++)
gm->mrp_target[i]->obj->setTravFuncs(PFTRAV_DRAW,
MrpTargetPreDraw,MrpTargetPostDraw);
gm - pointer to the shared memory
mrp_target[i]->obj - is of type *pfNode.
The pre and post draw functions are:
MrpTargetPreDraw();
MrpTargetPostDraw();
.......Here are those function declarations:
void
MrpTargetPreDraw(pfTraverser *trav, void *data)
{
int i,j;
pfChannel *current_chan = trav->getChan();
pfNode *current_node = trav->getNode();
if(!gm->USE_MRP_OCCLUSSION)
return;
for(i=0;i<NUM_MRP_CHANNELS;i++)
if(current_chan == gm->mrp_chan[i])
{
MrpChanShareData *chan_data =
( MrpChanShareData *)current_chan->getChanData();
for(j=0;j<TGTIG_NUM_TARGETS;j++)
if( current_node == gm->mrp_target[chan_data->target_index]->obj
)
ClearMRPStencilMask();
break;
}
return;
}
and.....
void
MrpTargetPostDraw(pfTraverser *trav, void *data)
{
int i,j;
pfChannel *current_chan = trav->getChan();
pfNode *current_node = trav->getNode();
if(!gm->USE_MRP_OCCLUSSION)
return;
// Check to see if this is an mrp channel
for(i=0;i<NUM_MRP_CHANNELS;i++)
if(current_chan == gm->mrp_chan[i])
{
MrpChanShareData *chan_data =
( MrpChanShareData *)current_chan->getChanData();
for(j=0;j<TGTIG_NUM_TARGETS;j++)
if( current_node == gm->mrp_target[chan_data->target_index]->obj
)
SetMRPStencilMask();
break;
}
return;
}
I use these pre and post callback to change stencil mask settings....
This routines are located in the same source file as all the draw and cull
callbacks for the channels;
If anyone has any advise or see something wrong, please let me know.
I really need to have this working. Thanks.
- Bryan Wasileski
McDonnell Douglas Training Systems
St. Louis, MO
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
Submissions: info-performer++at++sgi.com
Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:54:06 PDT