With Emscripten, is it possible to call a function pointer (thus a number) from JavaScript?
The signature of a function is a variable, so I cannot write an helper and do.
To illustrate the example, I have a function like this:
void* get_feature_activator(feature_t feat);
You should use it as follows:
void* activator = get_feature_activator(FEATURE_SPEAKER);
((void(*)(float))activator) (3.0);
To do the same with JavaScript:
var activator = _get_feature_activator(constants.FEATURE_SPEAKER);
// TODO: Need to call this pointer with one float
source
share