Node Draw Traversal Callbacks

New Message Reply Date view Thread view Subject view Author view

Bryan Wasileski (bwasileski++at++mdc.com)
Fri, 06 Dec 1996 06:27:33 -0600


Peformers:
  I seem to be having some difficulty with some assigning pre and post
node travseral callbacks. I have a class in which a public member is a
pfNode; the objects created from this class are allocated from shared
memory. After I initialize the class and it members, I go through the
member pfnodes and try to assign the pre and post draw traversals. The
very first pfNode cause the program to dump. The message says that it
is an illegal instruction. Below is a peice of the code...

    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


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:54:06 PDT

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