Skip to content
/ gol2p Public

A C++ implementation of Conway's Game of Life using SDL2 with support for WebAssembly (Wasm) via Emscripten

License

Notifications You must be signed in to change notification settings

arminms/gol2p

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub License Build and Deploy Build (Linux/macOS/Windows)

gol2p

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.

To compile and install gol2p

Desktop (Linux/macOS/Windows)

You need CMake version 3.19 or higher:

cmake -S . -B build && cmake --build build && cmake --install build

Browser (WebAssembly)

You need emsdk 3.1.63 or higher.

Manually

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

Using CMake

emcmake cmake -S . -B build-web && cmake --build build-web

And for running

emrun build-web/src/gol2p.html

YouTube Video

There is a recorded video about WebAssembly in general and gol2p on SHARCNET YouTube Channel: