0
0

Hi guys, the docs appear to be conflicted about the recent changes to the channel callbacks (version 4.19.09)

From the changelog:
[code:21njf39l]
FMOD_CHANNEL_CALLBACK parameters changed from unsigned int to void *
Channel::setCallback changed to remove ‘command’ parameter and per callback type callback capability.
[/code:21njf39l]
Which is reflected in the header file:
[code:21njf39l]
typedef FMOD_RESULT (F_CALLBACK *FMOD_CHANNEL_CALLBACK) (FMOD_CHANNEL *channel, FMOD_CHANNEL_CALLBACKTYPE type, void *commanddata1, void *commanddata2);
[/code:21njf39l]

From the docs:

[b:21njf39l]Channel::setCallback page[/b:21njf39l]: This looks like the old stuff
[code:21njf39l]
FMOD_RESULT F_CALLBACK mycallback(FMOD_CHANNEL *channel, FMOD_CHANNEL_CALLBACKTYPE type, unsigned int commanddata1, unsigned int commanddata2)
{
...
[/code:21njf39l]

[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.
[code:21njf39l]
FMOD_RESULT F_CALLBACK FMOD_CHANNEL_CALLBACK(
FMOD_CHANNEL * channel,
FMOD_CHANNEL_CALLBACKTYPE type,
int command,
void * commanddata1,
void * commanddata2
);
[/code:21njf39l]


An aside: you’re right, you shouldn’t just cast the function pointer to (FMOD_CHANNEL_CALLBACK) in setCallback!

  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.