stevenarella/www
iceiix a020ed6f2c
Update to glutin 0.22.0-alpha5, remove wasm_stub (#260)
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
2020-01-05 17:56:32 -08:00
..
.gitignore Add support for compiling WebAssembly wasm32-unknown-unknown target (#92) 2019-03-03 08:32:36 -08:00
README.md Update to glutin 0.22.0-alpha5, remove wasm_stub (#260) 2020-01-05 17:56:32 -08:00
bootstrap.js Add support for compiling WebAssembly wasm32-unknown-unknown target (#92) 2019-03-03 08:32:36 -08:00
index.html Add support for compiling WebAssembly wasm32-unknown-unknown target (#92) 2019-03-03 08:32:36 -08:00
index.js Add support for compiling WebAssembly wasm32-unknown-unknown target (#92) 2019-03-03 08:32:36 -08:00
package-lock.json Bump lodash from 4.17.11 to 4.17.15 in /www (#201) 2019-07-27 17:50:33 -07:00
package.json npm update www dependencies. Closes #182 2019-07-04 15:25:02 -07:00
webpack.config.js Add support for compiling WebAssembly wasm32-unknown-unknown target (#92) 2019-03-03 08:32:36 -08:00

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.