From: Changhee Han (changhee++at++ict.usc.edu)
Date: 06/20/2001 00:42:41
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
This archive was generated by hypermail 2b29 : Wed Jun 20 2001 - 00:44:59 PDT