setzer22/blackjack

Use `eframe`?

virtualritz opened this issue · 1 comments

I saw the app is currently not using egui's eframe.

Is there a reason for this? eframe would possibly enable web assembly/running in browser trivially and also make a bunch of platform specific integrations available effortlessly.

E.g:

  • Saving/restoring app state on close/open of app with a single:
    eframe::set_value(storage, eframe::APP_KEY, self);
  • File🠮Quit just being calling eframe::Frame::close()

etc.

Hi @virtualritz!

There is currently an ongoing rewrite to a different UI system. I haven't written a full consistent rationale yet, but you can find some of it here: #74

In that case, the project is moving further away from eframe, and I'm currently considering building on top of epaint so far with promising results:
new_gui_viewport

would possibly enable web assembly/running in browser trivially

Unfortunately, wasm support wouldn't work out of the box even when using eframe. On one hand, blackjack relies on some wgpu features (mainly storage buffers) that will only be available on WebGPU, not the WebGL backend of wgpu. And on the other hand, there are some non-Rust dependencies (currently, Luau itself, but I'm taking a look at libigl) that would make it a bit more complicated to natively compile for wasm.

That's not to say blackjack can't run on wasm, it would just take some extra work and hasn't been my priority so far.