mirror of
https://gitlab.com/Mr_Goldberg/goldberg_emulator.git
synced 2024-11-14 10:50:13 +01:00
Check if we actually created a new frame
This commit is contained in:
parent
548f21c2f0
commit
0711c83440
5 changed files with 60 additions and 51 deletions
|
@ -80,7 +80,8 @@ void DX10_Hook::prepareForOverlay(IDXGISwapChain* pSwapChain)
|
|||
initialized = true;
|
||||
}
|
||||
|
||||
ImGui_ImplDX10_NewFrame();
|
||||
if (ImGui_ImplDX10_NewFrame())
|
||||
{
|
||||
Windows_Hook::Inst()->prepareForOverlay(desc.OutputWindow);
|
||||
|
||||
ImGui::NewFrame();
|
||||
|
@ -91,6 +92,7 @@ void DX10_Hook::prepareForOverlay(IDXGISwapChain* pSwapChain)
|
|||
|
||||
pDevice->OMSetRenderTargets(1, &mainRenderTargetView, NULL);
|
||||
ImGui_ImplDX10_RenderDrawData(ImGui::GetDrawData());
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE DX10_Hook::MyPresent(IDXGISwapChain *_this, UINT SyncInterval, UINT Flags)
|
||||
|
|
|
@ -92,7 +92,8 @@ void DX11_Hook::prepareForOverlay(IDXGISwapChain* pSwapChain)
|
|||
initialized = true;
|
||||
}
|
||||
|
||||
ImGui_ImplDX11_NewFrame();
|
||||
if (ImGui_ImplDX11_NewFrame())
|
||||
{
|
||||
Windows_Hook::Inst()->prepareForOverlay(desc.OutputWindow);
|
||||
|
||||
ImGui::NewFrame();
|
||||
|
@ -103,6 +104,7 @@ void DX11_Hook::prepareForOverlay(IDXGISwapChain* pSwapChain)
|
|||
|
||||
pContext->OMSetRenderTargets(1, &mainRenderTargetView, NULL);
|
||||
ImGui_ImplDX11_RenderDrawData(ImGui::GetDrawData());
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE DX11_Hook::MyPresent(IDXGISwapChain *_this, UINT SyncInterval, UINT Flags)
|
||||
|
|
|
@ -176,7 +176,8 @@ void DX12_Hook::prepareForOverlay(IDXGISwapChain* pSwapChain)
|
|||
pDevice->Release();
|
||||
}
|
||||
|
||||
ImGui_ImplDX12_NewFrame();
|
||||
if (ImGui_ImplDX12_NewFrame())
|
||||
{
|
||||
Windows_Hook::Inst()->prepareForOverlay(sc_desc.OutputWindow);
|
||||
|
||||
ImGui::NewFrame();
|
||||
|
@ -208,7 +209,7 @@ void DX12_Hook::prepareForOverlay(IDXGISwapChain* pSwapChain)
|
|||
pCmdList->Close();
|
||||
|
||||
pCmdQueue->ExecuteCommandLists(1, (ID3D12CommandList**)&pCmdList);
|
||||
|
||||
}
|
||||
pSwapChain3->Release();
|
||||
}
|
||||
|
||||
|
|
|
@ -75,7 +75,8 @@ void DX9_Hook::prepareForOverlay(IDirect3DDevice9 *pDevice)
|
|||
initialized = true;
|
||||
}
|
||||
|
||||
ImGui_ImplDX9_NewFrame();
|
||||
if (ImGui_ImplDX9_NewFrame())
|
||||
{
|
||||
Windows_Hook::Inst()->prepareForOverlay(param.hFocusWindow);
|
||||
|
||||
ImGui::NewFrame();
|
||||
|
@ -85,6 +86,7 @@ void DX9_Hook::prepareForOverlay(IDirect3DDevice9 *pDevice)
|
|||
ImGui::Render();
|
||||
|
||||
ImGui_ImplDX9_RenderDrawData(ImGui::GetDrawData());
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE DX9_Hook::MyReset(IDirect3DDevice9* _this, D3DPRESENT_PARAMETERS* pPresentationParameters)
|
||||
|
|
|
@ -83,7 +83,8 @@ void OpenGL_Hook::prepareForOverlay(HDC hDC)
|
|||
|
||||
initialized = true;
|
||||
}
|
||||
ImGui_ImplOpenGL3_NewFrame();
|
||||
if (ImGui_ImplOpenGL3_NewFrame())
|
||||
{
|
||||
Windows_Hook::Inst()->prepareForOverlay(hWnd);
|
||||
|
||||
ImGui::NewFrame();
|
||||
|
@ -93,6 +94,7 @@ void OpenGL_Hook::prepareForOverlay(HDC hDC)
|
|||
ImGui::Render();
|
||||
|
||||
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
|
||||
}
|
||||
}
|
||||
|
||||
BOOL WINAPI OpenGL_Hook::MywglSwapBuffers(HDC hDC)
|
||||
|
|
Loading…
Reference in a new issue