ImGui.NET icon indicating copy to clipboard operation
ImGui.NET copied to clipboard

Docking & DockSpace

Open FrostplayGames opened this issue 5 years ago • 8 comments

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!

FrostplayGames avatar Oct 02 '20 14:10 FrostplayGames

@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).

mellinoe avatar Oct 03 '20 05:10 mellinoe

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.

babooncodes avatar Oct 15 '20 14:10 babooncodes

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.

IrishBruse avatar Oct 25 '20 21:10 IrishBruse

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.

mellinoe avatar Oct 27 '20 04:10 mellinoe

Hopefully this will be implemented soon 😄

Thraka avatar Feb 09 '21 07:02 Thraka

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

renenieuw avatar Mar 09 '21 23:03 renenieuw

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?

gregkwaste avatar Sep 11 '21 14:09 gregkwaste