Version/Branch of Dear ImGui:
Version: WP 177
Branch: docking
Back-end/Renderer/Compiler/OS
Back-ends: imgui_impl_opengl3.cpp + imgui_impl_morgoth.cpp (custom implementation forked from sdl)
Compiler: Visual Studio 2019
Operating System: Windows 10 Professional
My Issue/Question:
My engine start in headless mode and support multiple windows but the imgui main window paradigm dont allow me to dock or move windows into the other engine windows.
At the moment I'have a patched version that seem to work, I've tried to manually call AddUpdateViewport function and the system works fine but there are some other changes to be done like:
if (is_new_platform_window && viewport->PlatformHandle != NULL)I'know the standard use case is with a single main window but I think this feature will not exclude a main window paradigma, is more like an additional support for viewports with a NULL ImGuiWindow and a set of function the user can call (AddUpdateViewport, SetDefaultViewport, GetDefaultViewport)
Hello @morgoth990,
This has been discussed before and I like to support this mode of operation. I would be interested to see your changes (e.g. in the form of a repo or PR) for references. Likely won't be merged as-is but any extra reference will be useful. Someone actually submitted to me a codebase with similar change a year ago but it was made hastily with no git commits nor explanations for many changes and got essentially half lost :/
Two things come to mind:
GetMainViewport() will need to be reworked. Perhaps we need to rework/blur the lines between Viewport and Monitors in order to provide an abstraction that works with both use case. e.g. being able to retrieve a reference "default" origin.ImGuiViewportFlags_CanHostOtherWindows flag, and the use of that flag is probably a little ambiguous in some areas, may set to split the flag into multiple ones.(Also, while technically completely unrelated, supporting this mode of operation will get us in territories where features such as #2749 will be highly desirable!)
I've forked and committed the changes here: https://github.com/morgoth990/imgui/commit/beb1b3c55309b5650cbe569737c3a3c173329208
Thanks for the details and comments. Not sure when we'll be able to look into it but this is going to be a good reference.
Most helpful comment
I've forked and committed the changes here: https://github.com/morgoth990/imgui/commit/beb1b3c55309b5650cbe569737c3a3c173329208