CAD97 / fmod-rs

Rust bindings to FMOD Core and FMOD Studio
Other
7 stars 1 forks source link

Nit: `System::set_3d_rolloff_callback` is wrapped differently than all other callback APIs #16

Open CAD97 opened 1 year ago

CAD97 commented 1 year ago

Most callback APIs define a trait ThisThingCallback and take that as a turbofish, but Rolloff3dCallback is instead a type alias to extern "system" fn and passed as an optional function parameter.

Either set_3d_rolloff_callback should adapt to the style used everywhere else, or everywhere else should specify the callback as a function argument. Switching from enum CallbackImpl {} to struct CallbackImpl; makes this reasonable, but I still have a slight preference for the version which is clearly just type-level, since the callback functionality needs to be sent to FMOD as static function pointers (i.e. no &self).