Re: C++ node->setTravData

New Message Reply Date view Thread view Subject view Author view

Kowsik Guruswamy (kowsik++at++coryphaeus.com)
Tue, 26 Mar 1996 09:51:32 -0800


On Mar 26, 4:25pm, Angus Henderson wrote:
> Subject: C++ node->setTravData
> Has anyone got an example of a Performer 2.0-C++-node->setTravData ?
>
> I had a working version with Performer 1.2-C-pfNodeTravData, but when I
cannot
> get a valid pointer to my draw process in 2.0.
>
> I do something like....
>
> ExpTravData *edt[MAX_EXPLOSIONS];
>
>
> for(i = 0; i < MAX_EXPLOSIONS; i++)
> {
> edt[i] =
> (ExpTravData*)pfMalloc(sizeof(ExpTravData),pfGetSharedArena());
>
> node->setTravData( PFTRAV_DRAW, edt[i] );
> }
>
> In the pre node draw callback I always get a pointer to the last element of
edt
> and none of the others.

Which is exactly what the code does. Inside the loop you are overwriting the
nodeTravData with the ith element in the array.

Try moving the 'setTravData' outside the loop and make it

node->setTravData (PFTRAV_DRAW, edt);

K.

-- 
kowsik++at++coryphaeus.com     | pirts suiboM a hguorht neeb sah txet sihT
http://www.coryphaeus.com |
                          | You are not you, you are me! - arnie
work: (408)-395-4537 e201 |

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

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