From 7b531345120e6eb562801dfe0ae0800a995a8bd5 Mon Sep 17 00:00:00 2001 From: Nemirtingas Date: Fri, 16 Aug 2019 18:30:55 +0200 Subject: [PATCH] Initialize overlay after full initialization of UI. --- overlay_experimental/DX10_Hook.cpp | 3 ++- overlay_experimental/DX11_Hook.cpp | 3 ++- overlay_experimental/DX9_Hook.cpp | 3 ++- overlay_experimental/OpenGL_Hook.cpp | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/overlay_experimental/DX10_Hook.cpp b/overlay_experimental/DX10_Hook.cpp index 90dbff6..acaa653 100644 --- a/overlay_experimental/DX10_Hook.cpp +++ b/overlay_experimental/DX10_Hook.cpp @@ -96,9 +96,10 @@ void DX10_Hook::prepareForOverlay(IDXGISwapChain* pSwapChain) pDevice->CreateRenderTargetView(pBackBuffer, NULL, &mainRenderTargetView); pBackBuffer->Release(); - Hook_Manager::Inst().ChangeGameWindow(desc.OutputWindow); ImGui_ImplWin32_Init(desc.OutputWindow); ImGui_ImplDX10_Init(pDevice); + Hook_Manager::Inst().ChangeGameWindow(desc.OutputWindow); + initialized = true; } diff --git a/overlay_experimental/DX11_Hook.cpp b/overlay_experimental/DX11_Hook.cpp index 628ca7a..44967f7 100644 --- a/overlay_experimental/DX11_Hook.cpp +++ b/overlay_experimental/DX11_Hook.cpp @@ -109,9 +109,10 @@ void DX11_Hook::prepareForOverlay(IDXGISwapChain* pSwapChain) pDevice->CreateRenderTargetView(pBackBuffer, NULL, &mainRenderTargetView); pBackBuffer->Release(); - Hook_Manager::Inst().ChangeGameWindow(desc.OutputWindow); ImGui_ImplWin32_Init(desc.OutputWindow); ImGui_ImplDX11_Init(pDevice, pContext); + Hook_Manager::Inst().ChangeGameWindow(desc.OutputWindow); + initialized = true; } diff --git a/overlay_experimental/DX9_Hook.cpp b/overlay_experimental/DX9_Hook.cpp index 9fbad2b..98a6480 100644 --- a/overlay_experimental/DX9_Hook.cpp +++ b/overlay_experimental/DX9_Hook.cpp @@ -96,9 +96,10 @@ void DX9_Hook::prepareForOverlay(IDirect3DDevice9 *pDevice) ImGuiIO& io = ImGui::GetIO(); io.IniFilename = NULL; - Hook_Manager::Inst().ChangeGameWindow(param.hFocusWindow); ImGui_ImplWin32_Init(param.hFocusWindow); ImGui_ImplDX9_Init(pDevice); + Hook_Manager::Inst().ChangeGameWindow(param.hFocusWindow); + initialized = true; } diff --git a/overlay_experimental/OpenGL_Hook.cpp b/overlay_experimental/OpenGL_Hook.cpp index 7211883..bb5fed6 100644 --- a/overlay_experimental/OpenGL_Hook.cpp +++ b/overlay_experimental/OpenGL_Hook.cpp @@ -73,10 +73,10 @@ void OpenGL_Hook::prepareForOverlay(HDC hDC) ImGuiIO& io = ImGui::GetIO(); io.IniFilename = NULL; - Hook_Manager::Inst().ChangeGameWindow(hWnd); ImGui_ImplWin32_Init(hWnd); ImGui_ImplOpenGL3_Init(); + Hook_Manager::Inst().ChangeGameWindow(hWnd); initialized = true; }