nodes: Move ImNodes initialization to window class
This commit is contained in:
parent
d7c6451f53
commit
218f284678
@ -697,6 +697,7 @@ namespace hex {
|
||||
|
||||
GImGui = ImGui::CreateContext();
|
||||
GImPlot = ImPlot::CreateContext();
|
||||
GImNodes = ImNodes::CreateContext();
|
||||
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
ImGuiStyle& style = ImGui::GetStyle();
|
||||
@ -731,6 +732,14 @@ namespace hex {
|
||||
io.KeyMap[ImGuiKey_Y] = GLFW_KEY_Y;
|
||||
io.KeyMap[ImGuiKey_Z] = GLFW_KEY_Z;
|
||||
|
||||
ImNodes::PushAttributeFlag(ImNodesAttributeFlags_EnableLinkDetachWithDragClick);
|
||||
ImNodes::PushAttributeFlag(ImNodesAttributeFlags_EnableLinkCreationOnSnap);
|
||||
|
||||
{
|
||||
static bool always = true;
|
||||
ImNodes::GetIO().LinkDetachWithModifierClick.Modifier = &always;
|
||||
}
|
||||
|
||||
io.UserData = new ImGui::ImHexCustomData();
|
||||
|
||||
if (this->m_globalScale != 0.0f)
|
||||
@ -818,8 +827,12 @@ namespace hex {
|
||||
void Window::deinitImGui() {
|
||||
delete static_cast<ImGui::ImHexCustomData*>(ImGui::GetIO().UserData);
|
||||
|
||||
ImNodes::PopAttributeFlag();
|
||||
ImNodes::PopAttributeFlag();
|
||||
|
||||
ImGui_ImplOpenGL3_Shutdown();
|
||||
ImGui_ImplGlfw_Shutdown();
|
||||
ImNodes::DestroyContext();
|
||||
ImPlot::DestroyContext();
|
||||
ImGui::DestroyContext();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user