ImGuiNET / ImGui.NET

An ImGui wrapper for .NET.
MIT License
1.85k stars 300 forks source link

Docking & DockSpace #202

Open FrostplayGames opened 3 years ago

FrostplayGames commented 3 years ago

I am currently trying to implement docking and dockspace (copied from imgui_demo.cpp in the docking branch) but when I enable docking and dock the windows, next time I load the application, the windows have undocked themselves. I don't know if this is something wrong with my code or something else.

My question is, does anybody have any example code for docking and dockspaces with ImGui.NET that I could possibly take a look at so that I can achieve something that actually works?

Thank you in advanced and thank you for taking the time to read this issue!

mellinoe commented 3 years ago

@FrostplayGames I just tested this out with a very basic setup, and it seemed to work as expected. I think the key is that you need to have the Dockspace created before any of the other windows are drawn, and it may need to have a consistent ID between runs (that part would be handled if you used the code from imgui_demo). If I change the code so that the Dockspace isn't submitted on the very first frame (but is every frame afterwards), then the windows come undocked (although they retain their positions).

babooncodes commented 3 years ago

The api lacks DockBuilderRemoveNode and other DockBuilder api calls, which makes the docking branch here useless basically. Since everyone is trying to make some form of editor, lacking basic api to create premade docked layouts is a bummer. Ok not useless, but hindered.

IrishBruse commented 3 years ago

Yeah the docking branch is no different to the regular. @mellinoe what's the point of it there is one file different and its an example? I tried getting it working but the definitions file is so complicated and i cant change one thing with out getting so many errors.

mellinoe commented 3 years ago

The api lacks DockBuilderRemoveNode and other DockBuilder api calls, which makes the docking branch here useless basically. Since everyone is trying to make some form of editor, lacking basic api to create premade docked layouts is a bummer. Ok not useless, but hindered.

This is another reason to expose the imgui_internal.h header: https://github.com/mellinoe/ImGui.NET/issues/81. The reason this isn't available now is because only the public, "stable" parts of ImGui are currently wrapped. There's no longer any technical blocker to exposing the stuff in imgui_internal.h, though, and it really shouldn't be that difficult, because it is now parsed and processed in cimgui, just like the regular header is.

Thraka commented 3 years ago

Hopefully this will be implemented soon 😄

renenieuw commented 3 years ago

Open source projects are not really my thing, but I realy wanted to use the dockbuilder functionality. I've compiled the 1.81 docking branch on windows and eating my way through all the horrors and errors. The current state:

It compiles. It kinda runs with the dockbuilder. (the xna project) Works on my machine.

To be continued.

image

gregkwaste commented 3 years ago

Open source projects are not really my thing, but I realy wanted to use the dockbuilder functionality. I've compiled the 1.81 docking branch on windows and eating my way through all the horrors and errors. The current state:

It compiles. It kinda runs with the dockbuilder. (the xna project) Works on my machine.

To be continued.

image

Just started my journey to expose the internal branch of 1.82 and I've been overwhelmed with errors all over the place. I need a bit of advice since I haven't done that again. Should I manually fix any errors or everything is supposed to be automatically generated ready for building?

VELD-Dev commented 3 weeks ago

Hello, I've been using ImGui for quite a while now, and I wanted to know when would we be able to use the Dockbuilder ? I totally understand that it's not a priority or anything, but it would be very nice because actually, I have no way to just prebuild my dockspace arrangement, which can become quite difficult to "set-up" as an user when there is a lot of frames flying everywhere or all stacked on the same "window-stack".

I stay tuned !