a020ed6f2c
Update from glutin 0.21.x fork to glutin 0.22.0-alpha5 and corresponding compatible version of winit. This removes our custom temporary wasm_stub branches, back to mainline glutin and winit, and is a step towards WebAssembly compatibility, most importantly merging the game loop and event loops as required by winit _which now supports wasm_. Not yet functional on the web because other web dependencies have to be added, see #171 and #34, but native functionality is preserved. * Update for 0.22 glutin API changes: * Move game logic into event loop, run() replacing poll_events() * Specify fullscreen Borderless mode * Pass generic parameter of Event through handle_window_event * hidpi_factor() replaces get_hidpi_factor() * with_inner_size() replaces with_dimensions() * No longer need to unwrap() LogicalSize * set_cursor_grab/visible() replaces grab/hide_cursor() * Fix modifiers deprecated warnings by destructuring only event fields we use, ignoring the rest with '..' * Remove unnecessary mutability from events_loop * Listen for ModifiersChanged event, fixing deprecated modifiers field * Change to stdweb for web backend, replacing web-sys * Pin to glutin =0.22.0-alpha5 and winit =0.20.0-alpha6 |
||
---|---|---|
.. | ||
.gitignore | ||
README.md | ||
bootstrap.js | ||
index.html | ||
index.js | ||
package-lock.json | ||
package.json | ||
webpack.config.js |
README.md
stevenarella-web
Web app for running Stevenarella as WebAssembly
Status: very incomplete. It does not currently compile, due to required modifications to adapt to the web, for progress see: https://github.com/iceiix/stevenarella/issues/171.
Building
To build for wasm32-unknown-unknown, run in the top-level directory (not www):
rustup target add wasm32-unknown-unknown
cargo install wasm-bindgen-cli
wasm-pack build
or:
cargo web start --target wasm32-unknown-unknown
Running
After building the Rust app, run the NodeJS web server as follows:
cd pkg
npm link
cd ..
cd www
npm link stevenarella
npm install
npm start
open http://localhost:8080/
Credits
Based on [rustwasm/create-wasm-app](https://github.com/rustwasm/create-wasm-app)
:
An
npm init
template for kick starting a project that uses NPM packages containing Rust-generated WebAssembly and bundles them with Webpack.