简体   繁体   中英

ImGui OpenGL Game Engine

Hello I'm creating my first Game Engine with C++ and OpenGL, along with ImGui for the editor interface. I have a simple question, I created a window that covers the whole screen using:

ImGuiWindowFlags flags = ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse;
ImGui::Begin("ImGUI window", NULL, flags);
ImGui::End();

I also have docking enabled, I want to create a bunch of smaller windows (like tab windows) to be dockable inside of that main window. I tried doing that by using the BeginChild function but, while it created a child window it wasn't moveable in any way. I also tried creating another window but, when it's docked on the main window it goes fullscreen. Does anybody have any idea how I can achieve a bunch of child windows that are dockable and can be moved around?

I figured out I can solve this by making the whole screen dockable:

// make the whole screen dockable
ImGui::DockSpaceOverViewport(ImGui::GetMainViewport(), ImGuiDockNodeFlags_PassthruCentralNode);

and then adding the windows.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM