Re: data passing through callback function

New Message Reply Date view Thread view Subject view Author view

From: Lawrence bertoldi (lberto++at++md.prestige.net)
Date: 06/01/2001 13:42:17


Try using

vgUserData(vgCommon *handle,void *data);
and in the method use ........
void *mydata = vgGetUserData(vgCommon *handle);
now cast it to what ever type it is suposed to be!!

See Ya ~;-}>
lawrence bertoldi Graphics Software Engineer (for hire)
410.781.7286 lberto++at++md.prestige.net

Changhee Han wrote:

> Hello all,
> I want to know how to pass data to callback function, or to get value of
> global variable from inside callback function.
> I tried both
> (1)
> vgAddFunc( chan, VGCHAN_POSTDRAW, my_draw_callback, (void*)data_fd ); //this
> function is now defined after vgConfigSys().
> and
> (2)
> pfInit();
> pfInitArenas();
> new_fd_pt = (int *) pfMalloc(sizeof(int), pfGetSharedArena());;
> .....
> my_draw_callback(....){
> ......
> printf(......new_fd_pt);
> .......
> }
>
> But,
> by(1), I got worng value.
> by(2), I got below messages and wrong value
> PF Warning/Usage: pfGetSharedArena() Must call pfInit or
> pfInitArenas first.
> => warn pfInit() Already initialized. Must call pfExit() before
> reinitialization.
>
> PLEASE help me,
> Thanks in advance,
> changhee
> -----------------------------------------------------------------------
> 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 : Fri Jun 01 2001 - 13:33:46 PDT

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