-
-
Notifications
You must be signed in to change notification settings - Fork 11.2k
Closed
Labels
Description
Information:
Version: 1.76 WIP
Branch: docking
Back-ends: imgui_impl_opengl3.cpp + imgui_impl_glfw.cpp
Compiler: gcc
Operating System: linux, manjaro
My Issue/Question:
I seem to get a segmentation fault when executing this code multiple times during runtime:
if (ImGui::MenuItem("Default Layout")) {
ImGui::DockBuilderRemoveNode(mDockspaceID);
ImGui::DockBuilderAddNode(mDockspaceID, ImGuiDockNodeFlags_None);
ImGui::DockBuilderSetNodeSize(mDockspaceID, ImGui::GetMainViewport()->Size);
ImGuiID dock_main = mDockspaceID;
ImGuiID dock_right = ImGui::DockBuilderSplitNode(dock_main, ImGuiDir_Right, 0.3f, nullptr, &dock_main);
ImGuiID dock_down = ImGui::DockBuilderSplitNode(dock_main, ImGuiDir_Down, 0.3f, nullptr, &dock_main);
ImGui::DockBuilderDockWindow("Profiler##profiler1", dock_main);
ImGui::DockBuilderDockWindow("Scene##scene1", dock_main);
ImGui::DockBuilderDockWindow("Editor##editor1", dock_right);
ImGui::DockBuilderDockWindow("Console##console1", dock_down);
ImGui::DockBuilderDockWindow("Log##logger1", dock_down);
ImGui::DockBuilderFinish(mDockspaceID);
}
Full function:
The full function can be found here and to clarify, I call this function before creating any of the windows in the current frame.
https://hastebin.com/wayiroriwo.cpp
ocornut