WebAssembly C/C++ Examples
Using twr-wasm

These C and C++ examples demonstrate how to create different types of WebAssembly (wasm) programs with the twr-wasm library.
Server
URL Type
Bundled
crossOriginIsolated
Browser
WebAssembly Support
SharedArrayBuffer Support
Importmap Support


Example Description Links
Hello World The simplest twr-wasm example run
divcon Input from a <div>, calculates squares run-async-debug
terminal A simple terminal places strings at specific positions run-async
multi-io Use multiple i/o consoles run-async-debug
Balls Bouncing Balls using C++ and 2D Canvas API run
run-async
run-debug
Maze A port of legacy win32 C code to generate and solve a maze run-async
Pong Pong using C++ and 2D Canvas API run
run-async
FFT Example C library integration. JS draws input and output. Calls FFT C lib to calc FFT run
callC Demo module.callC arguments and return types run
run-async
lib example twrLibrary example run-debug
run-async
tests Run twr-wasm std c lib unit tests run
run-debug
run-async-debug
tests-user Test CLI includes tests that need human input or review. Written using libc++ with <canvas> io run-debug
tests-libcxx Smoke tests and example for libc++ run
tests-d2d Unit tests for Draw 2D canvas console run
run async
tests-audio Unit tests for Audio Library. WARNING: Turn volume all the way down before running as some of the test sounds are very loud. run
run async
tests-timer Unit tests for Timer Library. run
run async