pfAllocChanData

New Message Reply Date view Thread view Subject view Author view

Angus Henderson (angus++at++death.reading.sgi.com)
Tue, 11 Oct 94 10:13:01 GMT


I have an APP_CULL_DRAW with 3 channels on 1 pipe.
I have 1000 fish which swim arround the APP and want their positions
passed to the DRAW

Let us say I have a (PassData*) structure called FishPass which
holds all the fish data in the APP, if I had one channel I
would read the man page on pfAllocChanData and do

FishPass = (PassData*)pfAllocChanData( chan , sizeof(PassData) );

Then in each PreFrame I would

pfPassChanData(chan);

That is easy and it works, but I have three channels. Each seems to need
a personal "pfAllocChanData". However I only have one FishPass data
structure which is re-calculated once each pass after pfFrame in APP.

I have tried pfMalloc'ing FishPass once, then pfAllocChanData'ing
three channel data structures one for each channel, then copying
the contents of FishPass into the relevant channel data structure.
But this Segmentation faults each time.

    if(first)
    {
        for( i = 0; i < NumChans; i++)
        {
            passPtr[i] = (PassData*)pfAllocChanData(Chan[i], sizeof(PassData));
        }
        first = 0;
    }
     
    for( i = 0; i < NumChans; i++)
    {
        memcpy( passPtr[i] , FishPass, sizeof(PassData));
        pfPassChanData(Chan[i]);
    }

Have I missed the point somewhere ?

How do you send a single piece of Passdata to multiple channels ?

Angus
(Henderson
The Reality Centre)

"Imagine your witty quote here"


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:50:35 PDT

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