~/talk

Sandbox Games: Using WebAssembly and C++ to make a simple game

Talkat Meeting C++ 2022 · 2022-11-17..11-19· [webassembly, creative-coding]
slides:none on file

C++ game logic compiles to WebAssembly with Emscripten and runs in the browser, producing a sliding‑puzzle like 2048 implemented with exported functions and optional embind marshalling; rendering moves to SDL2 textures, fonts must be preload files, and a tiny Python or emrun server is required. Key hurdles: supply JS syscalls for random/timers, set initial memory and growth, preload assets, use source maps for breakpoints; a Wordle bot example hits ~30 games/sec and real projects sometimes report ~20× speedups.

AI-written summary · about

  1. 0:00Sandbox games with WebAssembly
  2. 1:45What this talk covers and its origins
  3. 3:10WebAssembly basics
  4. 8:27Setting up Emscripten for development
  5. 10:33Hello World in WASM
  6. 14:30Sliding puzzle game
  7. 15:54C++ and WASM game logic
  8. 20:14Randomness in sandbox
  9. 26:20Passing complex data between JavaScript and WebAssembly
  10. 34:31WASM graphics rendering
  11. 41:17Memory limits and growth
  12. 42:22External files embedding
  13. 44:54CMake and Emscripten build
  14. 46:17Challenges and solutions
  15. 48:43Live WASM game demo
  16. 55:16Q&A: Threads, libs, performance
  17. 1:01:20Q&A: Porting apps, Rust vs C++
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.