The code here is an experiment which uses the Simple DirectMedia Layer API to interact with the HTML <canvas>
element via WebAssembly. The C++ source code comes from the official Emscripten repo with some minor modifications, such as the removal of console logs.
View the live website here: https://emscripten.netlify.app/
If you’ve modified the C++ source code, please follow the steps below in order to generate the WASM binary and Javascript glue code. You need to have Emscripten installed on your machine. Visit the official docs for more details.
$ emcc -oz canvas.cpp -o canvas.wasm
$ emcc -oz canvas.cpp -o canvas.js