Check if we actually created a new frame

This commit is contained in:
Nemirtingas
2020-01-10 08:10:33 +01:00
parent 548f21c2f0
commit 0711c83440
5 changed files with 60 additions and 51 deletions

View File

@ -92,17 +92,19 @@ void DX11_Hook::prepareForOverlay(IDXGISwapChain* pSwapChain)
initialized = true;
}
ImGui_ImplDX11_NewFrame();
Windows_Hook::Inst()->prepareForOverlay(desc.OutputWindow);
if (ImGui_ImplDX11_NewFrame())
{
Windows_Hook::Inst()->prepareForOverlay(desc.OutputWindow);
ImGui::NewFrame();
ImGui::NewFrame();
get_steam_client()->steam_overlay->OverlayProc();
get_steam_client()->steam_overlay->OverlayProc();
ImGui::Render();
ImGui::Render();
pContext->OMSetRenderTargets(1, &mainRenderTargetView, NULL);
ImGui_ImplDX11_RenderDrawData(ImGui::GetDrawData());
pContext->OMSetRenderTargets(1, &mainRenderTargetView, NULL);
ImGui_ImplDX11_RenderDrawData(ImGui::GetDrawData());
}
}
HRESULT STDMETHODCALLTYPE DX11_Hook::MyPresent(IDXGISwapChain *_this, UINT SyncInterval, UINT Flags)