diff --git a/README.md b/README.md index 6f1ec91..f704c4f 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ This is an experimental repository while testing a Rust + SDL2 project built wit - [X] TTF - [ ] GFX - All of these libraries are common and necessary for a lot of projects. Ensuring they work is important. -- [ ] Example of External Javascript Interop +- [X] Example of External Javascript Interop - The basic ability to provide some kind of Javascript binding would be important for a decent web-based project or game. - The ability to use localStorage, fetch, or some browser-only API would be important. diff --git a/assets/index.html b/assets/index.html index e789571..8341436 100644 --- a/assets/index.html +++ b/assets/index.html @@ -4,19 +4,77 @@ rust-sdl2-emscripten + +

- rust-sdl2-emscripten

This is a demo of a simple program written in Rust using the SDL2 - library and compiled to WebAssembly using Emscripten. The game loop is - implemented directly in Rust and uses Emscripten's Asyncify feature, as - well as hooks to + library and compiled to WebAssembly using Emscripten.
+ The game loop is implemented directly in Rust and uses Emscripten's Asyncify feature, using hooks to + Emscripten's emscripten_sleep and emscripten_get_now for sleeping and timing.

@@ -24,6 +82,14 @@

Notes

This demo uses all four SDL2 extensions; Image, Mixer, TTF, and GFX. +
+ Builds are available in all major platforms, while Web Assembly is deployed to GitHub pages directly. +
+ Target-specific code is used to handle platform-specific features such as networking and file I/O. +
+ For example, volume is saved to a file on native platforms, while it is saved to local storage on the web (code). +
+ This project was created as a learning experience and test-bed for SDL2+Emscripten in support of my Pac-Man project.

Controls