Re: data passing through callback function

New Message Reply Date view Thread view Subject view Author view

From: Angus Dorbie (dorbie++at++sgi.com)
Date: 06/01/2001 15:14:58


Lawrence, you're for hire?!!
There's a few folks around who could really use your help.

Cheers,Angus.

Lawrence bertoldi wrote:
>
> 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
>
> -----------------------------------------------------------------------
> 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

-- 
For Performer+OpenGL tutorials http://www.dorbie.com/

"Whenever there is a conflict between human rights and property rights, human rights must prevail." --Abraham Lincoln


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Fri Jun 01 2001 - 15:18:08 PDT

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