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

Q: Multiple top-level windows? #552

Closed
jgarvin opened this issue Jul 8, 2021 · 5 comments
Closed

Q: Multiple top-level windows? #552

jgarvin opened this issue Jul 8, 2021 · 5 comments
Labels
native-glium Relates to running egui_glium on native

Comments

@jgarvin
Copy link

jgarvin commented Jul 8, 2021

I'm not sure if the APIs needed to do this exist for the web backend, but for native is multiple top-level window support a goal? It's something that non-game apps would probably use, since without it multi-monitor use of the same app is pretty inconvenient (you need one big native window to stretch over all your screens). Even for games might be nice for egui to be able to 'pop out' to be in a separate window from the game instead of always being an overlay.

@mitchmindtree
Copy link
Contributor

I'm considering starting to use egui alongside nannou for some of our audiovisual installation work. These often involve multi-screen or multi-projector setups with content split across each, separating the control window from the visualisation window, etc.

Even if there's no real "multi-window" support in egui, I'd be satisfied knowing that I could have a unique Ui per window without messing up any global state or anything like that. Does that sound feasible with egui in its current state?

Great work on the lib btw! I just came across the web demo and was blown away by the list of features :)

@parasyte
Copy link
Contributor

AFAIK, supporting multiple windows is mostly the responsibility of the platform implementation. For most users this is egui_glium, but it's also true of alternatives like egui_winit_platform.

egui_glium takes over handling of the windowing subsystem and the main event loop, so it is going to need some work to handle multiple windows.

egui_winit_platform puts all those responsibilities into the caller's hands, so it's up to the user to define how they want their windows created and managed. It should be trivial to have as many Platform instances as you like with a single event loop using this architecture. Each platform gives you its own CtxRef when you are ready to render the UI. You just have to be careful in your event loop to update the platform using events from the correct window reference.

@emilk
Copy link
Owner

emilk commented Aug 15, 2021

@parasyte is right - adding multi-window support to egui_glium is maybe possible, but I don't know. If you have an integration with multiple windows already, then having one egui::Context per window is the way to go, and should not produce any problems.

@emilk emilk added the native-glium Relates to running egui_glium on native label Aug 15, 2021
@parasyte
Copy link
Contributor

See also #1044

@emilk
Copy link
Owner

emilk commented Dec 29, 2023

eframe now support multiple viewports/windows.

The egui_glium backend has been moved out to a separate repo (https://github.com/fayalalebrun/egui_glium).

@emilk emilk closed this as completed Dec 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
native-glium Relates to running egui_glium on native
Projects
None yet
Development

No branches or pull requests

4 participants