// global key FXint global_key; yourfunc() { // assume 'effect' and 'target' are already initialized FXfloat *buffer = NULL; FXint num_points = 0; fxMeshNumPoints( target, &num_points, FX_NOFLAG ); if( !(buffer = (FXfloat *)fxDataCreate( target, &global_key, effect, num_points * sizeof(FXfloat))) ) { // report allocation error } //... }
#define FLOAT_BUFFER_KEYID 0 #define VECTOR_KEYID 1 FXcontrol myButton; FXint global_key; FXvecd a_vector; yourfunc() { static FXfloat some_buffer[100]; if( !fxDataSet( myButton, &global_key, FLOAT_BUFFER_KEYID, some_buffer ) ) { // report attachment error } if( !fxDataSet( myButton, &global_key, VECTOR_KEYID, a_vector ) ) { // report attachment error } // ... }
typedef struct { // fill in your data here }MyEffectData;
MyEffectData
structure: case O_CREATE: { MyEffectData *med = NULL; // allocate the data if( !(med = calloc(1, sizeof(MyEffectData))) ) // report error and return // attach the data to our effect instance fxObjectSetTypeData( effect, med, FX_NOFLAG ); }
© 2003 pmG WorldWide,
LLC.
|
Last
Updated on Thu Jul 10 04:49:36 2003
|