From 466c740ae1174fa87618aaa9c07d53e1a5ec5ad9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Fri, 1 Dec 2017 21:17:04 -0800 Subject: [PATCH] Disabled use of obsolete ImGui API. --- 3rdparty/ocornut-imgui/imconfig.h | 2 +- 3rdparty/ocornut-imgui/widgets/gizmo.inl | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/3rdparty/ocornut-imgui/imconfig.h b/3rdparty/ocornut-imgui/imconfig.h index 3d9e95bf3..4ccb6cacd 100644 --- a/3rdparty/ocornut-imgui/imconfig.h +++ b/3rdparty/ocornut-imgui/imconfig.h @@ -6,7 +6,7 @@ #pragma once -//#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS +#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS //---- Define your own ImVector<> type if you don't want to use the provided implementation defined in imgui.h //#include diff --git a/3rdparty/ocornut-imgui/widgets/gizmo.inl b/3rdparty/ocornut-imgui/widgets/gizmo.inl index 41347e06a..c8001b60e 100644 --- a/3rdparty/ocornut-imgui/widgets/gizmo.inl +++ b/3rdparty/ocornut-imgui/widgets/gizmo.inl @@ -655,7 +655,17 @@ namespace ImGuizmo { ImGuiIO& io = ImGui::GetIO(); - ImGui::Begin("gizmo", NULL, io.DisplaySize, 0, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoInputs | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoBringToFrontOnFocus); + const uint32_t flags = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoInputs | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoBringToFrontOnFocus; + ImGui::SetNextWindowSize(io.DisplaySize); + + const ImGuiCol bgColorIdx = GetWindowBgColorIdxFromFlags(flags); + ImGuiStyle& style = ImGui::GetStyle(); + const float oldAlpha = style.Colors[bgColorIdx].w; + style.Colors[bgColorIdx].w = 0.0f; + + ImGui::Begin("gizmo", NULL, flags); + + style.Colors[bgColorIdx].w = oldAlpha; gContext.mDrawList = ImGui::GetWindowDrawList();