Skip to content

Bouncing Balls - 2D Draw API Wasm Example

This example uses twr-wasm's 2D Draw API and a C++ Canvas class with WebAssembly and C++ to bounce balls around your HTML page.

The bouncing balls example demonstrates

  • C++
  • Using the twr-wasm draw 2D APIs that match Javascript Canvas APIs.
  • A C++ wrapper for the JavaScript Canvas class

This example does not use libc++, which results in smaller code size. For an example that uses libc++ see tests-libcxx.

Screen Grab of Balls Example