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

[Feature request/Discussion] Multiple Windows is it real windows or inside single WebWindow ? #8

Open
Pe3ucTop opened this issue Nov 15, 2024 · 1 comment

Comments

@Pe3ucTop
Copy link

Pe3ucTop commented Nov 15, 2024

Hello! Great project and future future vision !
I noticed feature "Multiple Windows" but in demo/example find single Web browser window with multiple canvas only.
So question is there possibility for real multiple browser windows?
I was using multiple Dear Imgui windows in standard application (not Web) from docker branch.
Is it possible with WebApp with this emscripten-glfw library?
I was looking for multi-window webapp around and find interesting article :
[https://medium.com/swlh/expanding-single-page-apps-into-multiple-browser-windows-e6d9bd155d59]
so could this library be used in similar approach ?

How do you think should this question be redirected to Emscripten / Dear Imgui ?

@ypujante
Copy link
Member

Thank you for your questions.

As explained in the documentation, this library associates the concept of a "window" (in this instance a GLFWwindow) to an HTML "canvas".

So the concept of multiple windows is tied to the concept of having multiple canvases in a single browser window.

Note that both SDL2 and the JavaScript GLFW implementation that comes with Emscripten use the same concept of "canvas is a window". But only this library supports more than one at a time. This can be seen in a more realistic example here WebGPU Shader Toy (you need Chrome to see it in action).

What you are asking about is having an application that spans multiple browser windows like the link you provided. It is definitely not supported at the moment by this library (or others like SDL2), because of the fact that a GLFW window is associated with a canvas, not a browser window.

I don't think that ImGui can help you with this because ImGui uses this library or SDL2 so unless it is provided by the library that would not happen IMO.

I am not familiar at all about how to build an application across browser windows and it is certainly not a trivial thing to do. That would change this library quite drastically. That doesn't mean it won't happen but it is definitely a massive project: it is like starting from scratch...

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