Our great sponsors
-
hello-rust-sdl2-wasm
A Rust repo which uses SDL2 for user interaction, and which can be run locally or compiled to WASM and run on the web
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
Only half true. Emscripten implements the SDL 1.2 (and also SDL_mixer 1.2) API in Javascript here: https://github.com/emscripten-core/emscripten/blob/main/src/.... On the other hand SDL 2 (and SDL_mixer 2) are proper ports (which you linked to).
So there's quite a size penalty to using SDL 2 rather than SDL 1.2.
https://github.com/MeoMix/symbiants Here's my open source game written in Rust and compiled to WASM if you want more reading material :) It uses Bevy not SDL2, though.
https://github.com/parasyte/pixels
That gives you a simple software framebuffer, and it builds as a native app or for the web.
Related posts
- WebAssembly Playground
- What is a really cool thing you would want to write in Rust but don't have enough time, energy or bravery for?
- Rust and web assembly - noob question
- 3 years of fulltime Rust game development, and why we're leaving Rust behind
- Egui 0.27 – easy-to-use immediate mode GUI for Rust