Disabled use of obsolete ImGui API.

This commit is contained in:
Branimir Karadžić 2017-12-01 21:17:04 -08:00
parent 907f835881
commit 466c740ae1
2 changed files with 12 additions and 2 deletions

View File

@ -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 <vector>

View File

@ -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();