A C++ implementation of Conway's Game of Life using SDL2 with support for WebAssembly (Wasm) via Emscripten.
Go to https://arminms.github.io/gol2p to see Wasm version in action.
You need CMake version 3.19 or higher:
cmake -S . -B build && cmake --build build && cmake --install build
You need emsdk 3.1.63 or higher.
em++ -O3 src/gol.cpp -o index.html --shell-file src/template.html --preload-file src/font.ttf --use-port=sdl2 --use-port=sdl2_ttf -s ALLOW_MEMORY_GROWTH
And for running:
emrun index.html
emcmake cmake -S . -B build-web && cmake --build build-web
And for running
emrun build-web/src/gol2p.html
There is a recorded video about WebAssembly
in general and gol2p
on SHARCNET YouTube Channel: