Support multiple windows on desktop platforms only #532
Labels
No labels
CI
all
basisu
blog
bug
build
contributor-friendly
core
correctness
deferred
dev
direct3d-headers
docs
driver-os-issue
duplicate
dxcompiler
editor
examples
experiment
feature-idea
feedback
flac
freetype
gamemode
gkurve
glfw
gpu
gpu-dawn
harfbuzz
help welcome
in-progress
infrastructure
invalid
libmach
linux-audio-headers
long-term
mach
mach.gfx
mach.math
mach.physics
mach.testing
model3d
needs-triage
object
opengl-headers
opus
os/linux
os/macos
os/wasm
os/windows
package-manager
priority
proposal
proposal-accepted
question
roadmap
slipped
stability
sysaudio
sysgpu
sysjs
validating-fix
vulkan-zig-generated
wayland-headers
website
wontfix
wrench
www
x11-headers
xcode-frameworks
zig-update
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
hexops/mach#532
Loading…
Add table
Add a link
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?
I'd like to support multiple windows on desktop platforms (e.g. for the editor to have breakout windows that dock/undock if you drag'n'drop a window onto the main one.)
Of course, multiple windows will not work on most other platforms (at least mobile, consoles, etc.) - WASM would be nice-to-have.
Here's a starting point perhaps?
Core.createWindow, it returns a new*Windowtype (which I imagine would largely have identical fields toCoretoday.)Window.setOptions,Window.setShouldClose,Window.getFramebufferSize,Window.getSize,Window.closeThen inside your app's
pub fn initorpub fn updateyou could call this API to create a new window and render to it.I am very interested in seeing this feature happen. I looked over what it could take to do it and has some questions to refine what you had in mind.
Why differentiate the main_window from other windows? Why not have all windows, whether a pop-up or undock or other hierarchical relationship, or just two windows under the same app treated all the same way? All window creation would return an EntityID.
Do not Windows need to know which entities are contained within? The database needs to record which window the entities are in and when a window is destroyed, the entities need to be destroyed or moved to another window (such as redocking the undocked window).
Is there a relationship or dependency to control on windows? Or let the user choose to destroy child windows by callback from the destruction of the parent?
Thoughts?
Hey @kchilton - there is a major API design change of the
Core.zigAPI currently underway, and also our ECS. It's been discussed briefly in the Discord #contributing channel, and I'll have a PR up for it in the next few weeks probably.After that change we'll be able to support this easily I think.
Thanks for responding. I looked over the Discord and the subthread "thinking on new ECS thingy". I would have loved hearing more of the discussion related to inversion of control, how ECS affects the interfaces, and how to handle parallelism. It looks like I could have learned a lot from that exploration.
I envisioned a framework registry that could even handle context-selected composition roots, which should make the scenarios above (undocking, popups, ...) intuitive. Of course, such a more complicated framework could be layered on top of Mach, which is what I was working on for the simple purpose of assembling a GUI and modeling framework to support my future projects when I stumbled on this Issue. I look forward to seeing the new ECS design!