Re: how to read(or pass) the data set in chan draw callback

New Message Reply Date view Thread view Subject view Author view

From: Lawrence bertoldi (lberto++at++md.prestige.net)
Date: 06/20/2001 09:41:21


look at pfChannel:: setChanData & getChanData

You could pass the channel as the pfNode::setTravData((void *) chan)
retrieve it in the nodes preDraw callback and then extract the channel data
using
pfChannel::getChanData();

See Ya ~;-}>
Lawrence Eugene Bertoldi
lberto++at++md.prestige.net

"Spel chekeng coode iz ah wast ov tiem"

Changhee Han wrote:

> Dear Performers;
> I have a code which has tons of bug like below.
> Could you give some valuable advice to me?
>
> What I want to do is that, inside of node predraw callback(or anywhere), I
> want to read(or print) the value of "passeddata" which is set inside of
> channel draw callback.
> Or, how to pass data through channel callback function ?
> Thank you very much in advance.
> Changhee
> ////// beggining of the code
> int passeddata;
>
> main(){
> ..
> vgConfing();
> ..
> post_config();
> ..
> while{
> ..
> vgFrame();
> ..
> }
> }
>
> void post_config(){
> n= vgGetNumChan();
> for( i=0;i<n;i++ ){
> vgChannel* chan = vgGetChan( i );
> pfchan= vgGetPfChan(chan);
>
> pfchan->allocChanData(sizeof(int));
> pfchan->setChanData((void *)passeddata, sizeof(int));
> pfchan->passChanData();
> pfchan->setTravFunc(PFTRAV_DRAW, my_draw_callback);
> }
> }
>
> void my_draw_callback(pfChannel* pfchan, void* _userData){
> int mode= (int)_userData;
> mode = 10;
> ....
> pfDraw();
> ...
> }
>
> void node_predraw(pfTraverser* _trav, void* _userData){
> int mode = (int)_userData;
> printf("mode=%d\n",mode);
> .....
> }
> //////// end of code
> -----------------------------------------------------------------------
> List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> Open Development Project: http://oss.sgi.com/projects/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 2b29 : Wed Jun 20 2001 - 09:31:19 PDT

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