Create example using WebAssembly #15
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: rafaelcaricio/lvgl-rs#15
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Create a WebAssembly demo app using the web simulator of
embedded_graphics
library. It would be a great way to show the possibilities oflvgl-rs
by compiling to WASM. The example can also be a quick start for many people.Does anyone managed to run it on WebAssembly? When I try to build it I get the following error:
Hey @FloVanGH , I haven't tried yet. But I'd imagine that to compile to WebAssembly we would need to tweak our
build.rs
to handle cases like this one.Hey @rafaelcaricio.If you can adjust the
build.rs
I can contribute an example 🙂.I want to add an lvgl example to my crate: https://codeberg.org/morph/canvas-display. I have also a working desktop example for an other crate https://codeberg.org/morph/raqote-display.
@FloVanGH I can work on updating the
build.rs
, but I'm pretty tight on free time right now so I cannot compromise when I can do it. I hope to get some time to work on lvgl-rs soon.Awesome work, btw! :)
Ok I see. It's not urgent. But I hope you'll find some time. And I hope you can continue your work, it's really great 🙂.
Thank you 🙂
I've tried that this weekend and didn't work yet. I will continue trying to compile for the
wasm32-unknown-emscripten
target, that one may work (https://github.com/rustwasm/team/issues/291).Hey, ok thank you for your effort 🙂.
@FloVanGH after many hours of trial and error, it's possible to compile lvgl-rs to WASM after those changes https://github.com/rafaelcaricio/lvgl-rs/pull/31
I have an example here: https://github.com/rafaelcaricio/lvgl-rs-wasm (needs Rust nightly)
It compiles, but doesn't work in the browser. It panics at some slice index that supposed to not happen. Works fine when compiled to local binary.
@rafaelcaricio that's awesome :-) . Thank you. I will create an example for
canvas-display
.@FloVanGH No problem! Let me know if it works for you in the browser. As I said, even though I managed to make the example project compile successfully, it panics when running in the browser for some strange reason.
Ok thank you. I will check it.
@FloVanGH I managed to make it work! 🥳 The example project is running here: https://rafaelcaricio.github.io/lvgl-rs-wasm/
Example code: https://github.com/rafaelcaricio/lvgl-rs-wasm
🎉