Skip to content

Multiple main viewports / or no main viewport #3350

@morgoth990

Description

@morgoth990

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:

  • some checks on the PlatformWindowCreated bool to not exclude the viewports from processing
  • exclusion from UpdatePlatformWindows:
    in my case with
    if (is_new_platform_window && viewport->PlatformHandle != NULL)
    but probably there is a better way to achieve that
  • some asserts on non main viewports
  • introduction of a defaultViewport in the context with correlate Set/Get methods to allow to render elements like main menu bars on a specific window

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)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions