Brian Furtaw (brian++at++dingbat.clubfed.sgi.com)
Wed, 14 May 1997 08:02:57 -0400
Are you having difficulty because you have not declared the callback as a
static function. If you don't declare your callbacks as static functions their
is an extra argument passed by CC, the `this' pointer which is used implicitly
when you reference member variables in methods. Try declaring walk with your
arguments filled in for void like this...
static void people::walk(void)
Brian
On Apr 18, 10:22am, Garrett Williams wrote:
> Subject: ->setTravFuncs
> I am trying to set up a callback within a class.
>
> I am calling this in the constructor of the class..
>
> mv_body->setTravFuncs(PFTRAV_CULL,(pfNodeTravFuncType)walk,NULL);
>
> or
>
> mv_body->setTravFuncs(PFTRAV_CULL,(pfNodeTravFuncType)people::walk,NULL);
>
> both compile BUT::: neither works....
> It seams that it will call the function (walk) properly but the function
> fails to get the proper value from a protected: varable. I have tried
> changing the varable to public and private but I recive a core when ran.
>
> I recive the warning:
>
> warning(3676): pointer-to-member-function cast to pointer
> to function
>
> mv_body->setTravFuncs(PFTRAV_CULL,(pfNodeTravFuncType)walk,NULL);
>
> maby I am missing somthing in C++ or in the proper use of
> ->setTravFuncs..
>
> all help would be liked:::Thanks for the help...
>
> Garrett
> =======================================================================
> List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
>
>-- End of excerpt from Garrett Williams
--
----oOOo---- ----oOOo---- ----oOOo---- ----oOOo----
Brian Furtaw (brian++at++sgi.com)
VisSim Technical Consultant
12200-G Plum Orchard Drive Office:(410)796-0394 Fax: (301)872-3293
Silver Spring, Maryland 20904 OpenGL/ImageVision/OpenInventor/Performer
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
Submissions: info-performer++at++sgi.com
Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:55:13 PDT