Hi guys, the docs appear to be conflicted about the recent changes to the channel callbacks (version 4.19.09)
From the changelog:
FMOD_CHANNEL_CALLBACK parameters changed from unsigned int to void *
Channel::setCallback changed to remove ‘command’ parameter and per callback type callback capability.
Which is reflected in the header file:
typedef FMOD_RESULT (F_CALLBACK *FMOD_CHANNEL_CALLBACK) (FMOD_CHANNEL *channel, FMOD_CHANNEL_CALLBACKTYPE type, void *commanddata1, void *commanddata2);
From the docs:
[b:21njf39l]Channel::setCallback page[/b:21njf39l]: This looks like the old stuff
FMOD_RESULT F_CALLBACK mycallback(FMOD_CHANNEL *channel, FMOD_CHANNEL_CALLBACKTYPE type, unsigned int commanddata1, unsigned int commanddata2)
[b:21njf39l]FMOD_CHANNEL_CALLBACK page[/b:21njf39l]: The commanddata1&2 have changed type, but there’s still a [i:21njf39l]command[/i:21njf39l] param.
FMOD_RESULT F_CALLBACK FMOD_CHANNEL_CALLBACK(
FMOD_CHANNEL * channel,
void * commanddata1,
void * commanddata2
An aside: you’re right, you shouldn’t just cast the function pointer to (FMOD_CHANNEL_CALLBACK) in setCallback!
- kibibu asked 10 years ago
- You must login to post comments