November 2019
Intermediate to advanced
448 pages
15h 6m
English
As mentioned in the previous section, the EM_JS macro offers a way of declaring JavaScript functions right in your C or C++ code. With the EM_ASM macros, you don’t declare a JavaScript function explicitly. Instead, you write inline JavaScript in your C code. With both the EM_JS and EM_ASM macros, the JavaScript code isn’t really within the C code. The Emscripten compiler actually creates the necessary JavaScript functions and calls them behind the scenes when the module is running.
There are several variations of the EM_ASM macro available:
The EM_ASM and EM_ASM_ macros don’t return a value. The EM_ASM_INT macro returns an integer, and the EM_ASM_DOUBLE macro returns a double. ...
Read now
Unlock full access