foo
and assigned it the address of a function called bar,
I could use it as if it were bar:
int bar(int i) { return i; } void somefunc() { int val; int (*foo)(int); foo = &bar; val = foo(3); // val == 3 val = bar(4); // val == 4 }
FX_API(FXint, fxInitAction)(FXint action_module);
// Declare function FX_ACCESSFUNC(MyCallback); // ... // Define function FX_ACCESSFUNC(MyCallback) { // ... }
FX_ACCESSFUNC(MyCallback)
expands to the signature of the function, with MyCallback
as its name. Because you are not hard coding the arguments and return type of the function, your code is shielded from changes made to messiahAPI. It is strongly recommended that you use Callback Signature Macros wherever provided.access_func() | FX_ACCESSFUNC() | Called by messiah to handle Access Notifications |
entry_func() | FX_ENTRYFUNC() | Called by access_func() to handle Access Notifications |
exp_func() | FX_EXPFUNC() | Called by messiah to execute Function Module |
shader_func() | FX_SHADEREVALUATE() | Called by messiah to evaluate a Shader Module |
shader_init_func() | FX_SHADERINITINPUTS() | Called by messiah to initialize a Shader Module |
control_func() | FX_CONCALLBACK() | Called by messiah to inform a Module of events associated with a its controls |
scan_func() | FX_EFFECTSCAN() | Called indirectly by plugin to enumerate an Effect's targets |
disp_func() | FX_DISPLACESCAN() | Called indirectly by plugin to enumerate an Object's points for displacement |
hierarchy_func() | FX_HIERARCHYSCAN() | Called indirectly by plugin to enumerate an Object hierarchy |
// get state data from the effect MyEffectData *med = fxObjectGetTypeData( effect, FX_NOFLAG ); // start the target enumeration // with med being passed to each call of our callback fxEffectTargetScan( effect, MyScanFunc, med, FX_NOFLAG ); // ... // Our target enumeration callback ( scan_func() ) FX_EFFECTSCAN( MyScanFunc, MyEffectData, theData ) { // now theData is a MyEffectData * that points to // our effect's state data, neat huh? // displace points // ... return FX_TRUE; }
© 2003 pmG WorldWide,
LLC.
|
Last
Updated on Thu Jul 10 04:49:36 2003
|