From 325c6bd1d9bf081125af81abdb78570548329f6f Mon Sep 17 00:00:00 2001 From: varnicas Date: Mon, 24 Jun 2024 11:10:38 +0000 Subject: [PATCH] Update 'README.md' --- README.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 59f5a23..7ddaf44 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,11 @@ Link for compiling code with Embind → https://emscripten.org/docs/porting/conn ``` emcc -lembind -o test.js test.cpp -s NO_EXIT_RUNTIME=1 -s "EXPORTED_RUNTIME_METHODS=['ccall']" ``` -- EMSCRIPTEN_BINDINGS macro is used to bind the C++ function to make it callable from JavaScript -- Emscripten compiles the C++ code to WebAssembly, generating a .wasm file and JavaScript glue code that loads the WebAssembly module and sets up the bindings -- When the HTML page is loaded, test.js is executed, loading the WebAssembly module , Emscripten's Module object is created, exposing the C++ functions (like myFunction) to JavaScript -- Example of using Module: var result = Module.myFunction(input) \ No newline at end of file +- **EMSCRIPTEN_BINDINGS** macro is used to bind the C++ function to make it callable from JavaScript + +- Emscripten compiles the C++ code to WebAssembly, generating a **.wasm** file and **JavaScript** glue code that loads the WebAssembly module and sets up the bindings + +- When the HTML page is loaded, **test.js** is executed, loading the WebAssembly module , Emscripten's Module object is +created, exposing the C++ functions (like myFunction) to JavaScript + +- Example of using **Module**: var result = Module.myFunction(input) \ No newline at end of file