Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for single-threaded environments #1

Open
ecton opened this issue Jul 11, 2023 · 2 comments
Open

Add support for single-threaded environments #1

ecton opened this issue Jul 11, 2023 · 2 comments

Comments

@ecton
Copy link
Member

ecton commented Jul 11, 2023

If we want to allow WASM applications to be built with appit, we need to have a code path that supports:

  • Preventing opening more than one window
  • Does not spawn any threads
@daxpedda
Copy link
Member

A main use-case in Winit is integrating your Rust application into a bigger web page, which is the reason why Winit supports multiple windows in Wasm.

Personally I'm not a fan of that and I think if users want to put their Rust application into a bigger web page they should just put it into an IFrame or something. Though some users also want support of JS integration with their Winit app, again, not a fan.

Just putting it out there, personally I don't have a use-case for it nor do I favor it's support.

@ecton
Copy link
Member Author

ecton commented Jul 12, 2023

I hadn't even thought about that! For Gooey, I've been trying to decide if I would even use this. To me, this is more about supporting a game written in Kludgine, where you want to take over the whole browser window or a single canvas with the Kludgine app. I'm not sure I care about multi-canvas "app"s written in Kludgine -- I don't even want to think of the API to support that :)

For Gooey's Canvas, for a v1, I'm probably going to just wrap the browser's drawing APIs. Later, I'd love to use Kludgine, but I'm pretty sure it'll be using Kludgine without winit/appit -- just using wgpu to attach to the canvas directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants