From aa6dc7701f7d752174c34c02a09afd7e97295d5e Mon Sep 17 00:00:00 2001 From: falkTX Date: Mon, 6 May 2024 12:36:47 +0200 Subject: [PATCH] Set IMGUI_DISABLE_* flags in config, to prevent type conflicts Signed-off-by: falkTX --- opengl/DearImGui.hpp | 3 +-- opengl/DearImGui/imconfig.h | 4 ++-- opengl/DearImGuiColorTextEditor/TextEditor.cpp | 4 ++-- tests/imgui.cpp | 1 - 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/opengl/DearImGui.hpp b/opengl/DearImGui.hpp index 828a552..ce0aae9 100644 --- a/opengl/DearImGui.hpp +++ b/opengl/DearImGui.hpp @@ -1,7 +1,7 @@ /* * Dear ImGui for DPF * Copyright (C) 2021 Jean Pierre Cimalando - * Copyright (C) 2021-2023 Filipe Coelho + * Copyright (C) 2021-2024 Filipe Coelho * * Permission to use, copy, modify, and/or distribute this software for any purpose with * or without fee is hereby granted, provided that the above copyright notice and this @@ -22,7 +22,6 @@ #include "StandaloneWindow.hpp" #define IMGUI_DEFINE_MATH_OPERATORS -#define IMGUI_DISABLE_OBSOLETE_KEYIO #include "DearImGui/imgui.h" #include "DearImGuiKnobs/imgui-knobs.h" diff --git a/opengl/DearImGui/imconfig.h b/opengl/DearImGui/imconfig.h index 876cf32..0986177 100644 --- a/opengl/DearImGui/imconfig.h +++ b/opengl/DearImGui/imconfig.h @@ -27,8 +27,8 @@ //#define IMGUI_API __declspec( dllimport ) //---- Don't define obsolete functions/enums/behaviors. Consider enabling from time to time after updating to avoid using soon-to-be obsolete function/names. -//#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS -//#define IMGUI_DISABLE_OBSOLETE_KEYIO // 1.87: disable legacy io.KeyMap[]+io.KeysDown[] in favor io.AddKeyEvent(). This will be folded into IMGUI_DISABLE_OBSOLETE_FUNCTIONS in a few versions. +#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS +#define IMGUI_DISABLE_OBSOLETE_KEYIO // 1.87: disable legacy io.KeyMap[]+io.KeysDown[] in favor io.AddKeyEvent(). This will be folded into IMGUI_DISABLE_OBSOLETE_FUNCTIONS in a few versions. //---- Disable all of Dear ImGui or don't implement standard windows/tools. // It is very strongly recommended to NOT disable the demo windows and debug tool during development. They are extremely useful in day to day work. Please read comments in imgui_demo.cpp. diff --git a/opengl/DearImGuiColorTextEditor/TextEditor.cpp b/opengl/DearImGuiColorTextEditor/TextEditor.cpp index 0d8d8bd..eb934b8 100644 --- a/opengl/DearImGuiColorTextEditor/TextEditor.cpp +++ b/opengl/DearImGuiColorTextEditor/TextEditor.cpp @@ -1136,7 +1136,7 @@ void TextEditor::Render(const char* aTitle, const ImVec2& aSize, bool aBorder) if (mHandleKeyboardInputs) { HandleKeyboardInputs(); - ImGui::PushAllowKeyboardFocus(true); + ImGui::PushTabStop(true); } if (mHandleMouseInputs) @@ -1146,7 +1146,7 @@ void TextEditor::Render(const char* aTitle, const ImVec2& aSize, bool aBorder) Render(); if (mHandleKeyboardInputs) - ImGui::PopAllowKeyboardFocus(); + ImGui::PopTabStop(); if (!mIgnoreImGuiChild) ImGui::EndChild(); diff --git a/tests/imgui.cpp b/tests/imgui.cpp index 444bd6c..df4fe0e 100644 --- a/tests/imgui.cpp +++ b/tests/imgui.cpp @@ -19,7 +19,6 @@ #include "Application.hpp" #include "../opengl/DearImGui.cpp" -#include "../opengl/DearImGuiColorTextEditor.cpp" START_NAMESPACE_DGL