dtcristo / bevy_pixels

Bevy plugin that uses Pixels (a tiny pixel buffer) for rendering
https://docs.rs/bevy_pixels
Apache License 2.0
84 stars 12 forks source link

WASM compatibility? #12

Closed scambier closed 2 years ago

scambier commented 2 years ago

I'm working on a game that runs on Windows and WASM. It already uses Pixels and Bevy (though not bevy_pixels), but the main loop is managed by Pixels and the glue code I'm using to transfer things like inputs to Bevy is kinda ugly. I tried using your plugin to get something cleaner, but it doesn't build for the web. So I also tried to implement the Pixels example, but it's a task way too complex for my rust skill level.

Do you think it's something achievable, and if I may ask, would you mind make your plugin compatible with WASM? Thank you :)

dtcristo commented 2 years ago

Hi! I do want to support WASM. However, I don't have much time right now to implement it. No promises it will get done any time soon.

dtcristo commented 2 years ago

Hi @scambier. I've added initial WASM support into main here. This has not made its way into a release yet, but will as soon as pixels 0.10 is released.

I'm still planning on making some changes in the example to support a resizable canvas, but for now it runs with a fixed canvas size.