mirror of
https://gitlab.com/Mr_Goldberg/goldberg_emulator.git
synced 2025-12-05 03:34:52 +01:00
Added the possibility to create new fonts.
Fonts cannot be created after a NewFrame call.
This commit is contained in:
parent
e82579b82c
commit
6c09635600
8 changed files with 70 additions and 50 deletions
|
|
@ -75,6 +75,8 @@ void DX10_Hook::prepareForOverlay(IDXGISwapChain* pSwapChain)
|
|||
|
||||
pDevice->Release();
|
||||
|
||||
get_steam_client()->steam_overlay->CreateFonts();
|
||||
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
|
|
@ -83,9 +85,7 @@ void DX10_Hook::prepareForOverlay(IDXGISwapChain* pSwapChain)
|
|||
|
||||
ImGui::NewFrame();
|
||||
|
||||
get_steam_client()->steam_overlay->OverlayProc(desc.BufferDesc.Width, desc.BufferDesc.Height);
|
||||
|
||||
ImGui::EndFrame();
|
||||
get_steam_client()->steam_overlay->OverlayProc();
|
||||
|
||||
ImGui::Render();
|
||||
|
||||
|
|
|
|||
|
|
@ -87,6 +87,8 @@ void DX11_Hook::prepareForOverlay(IDXGISwapChain* pSwapChain)
|
|||
|
||||
pDevice->Release();
|
||||
|
||||
get_steam_client()->steam_overlay->CreateFonts();
|
||||
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
|
|
@ -95,9 +97,7 @@ void DX11_Hook::prepareForOverlay(IDXGISwapChain* pSwapChain)
|
|||
|
||||
ImGui::NewFrame();
|
||||
|
||||
get_steam_client()->steam_overlay->OverlayProc(desc.BufferDesc.Width, desc.BufferDesc.Height);
|
||||
|
||||
ImGui::EndFrame();
|
||||
get_steam_client()->steam_overlay->OverlayProc();
|
||||
|
||||
ImGui::Render();
|
||||
|
||||
|
|
|
|||
|
|
@ -87,6 +87,8 @@ void DX12_Hook::prepareForOverlay(IDXGISwapChain* pSwapChain)
|
|||
|
||||
pDevice->Release();
|
||||
|
||||
get_steam_client()->steam_overlay->CreateFonts();
|
||||
|
||||
initialized = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -130,9 +132,7 @@ void STDMETHODCALLTYPE DX12_Hook::MyExecuteCommandLists(ID3D12CommandQueue *_thi
|
|||
|
||||
ImGui::NewFrame();
|
||||
|
||||
get_steam_client()->steam_overlay->OverlayProc(me->sc_desc.BufferDesc.Width, me->sc_desc.BufferDesc.Height);
|
||||
|
||||
ImGui::EndFrame();
|
||||
get_steam_client()->steam_overlay->OverlayProc();
|
||||
|
||||
((ID3D12GraphicsCommandList*)ppCommandLists[i])->SetDescriptorHeaps(1, &me->pSrvDescHeap);
|
||||
ImGui::Render();
|
||||
|
|
|
|||
|
|
@ -55,12 +55,6 @@ void DX9_Hook::resetRenderState()
|
|||
// Try to make this function and overlay's proc as short as possible or it might affect game's fps.
|
||||
void DX9_Hook::prepareForOverlay(IDirect3DDevice9 *pDevice)
|
||||
{
|
||||
IDirect3DSwapChain9* pSwapChain;
|
||||
pDevice->GetSwapChain(0, &pSwapChain);
|
||||
D3DPRESENT_PARAMETERS PresentParameters;
|
||||
pSwapChain->GetPresentParameters(&PresentParameters);
|
||||
pSwapChain->Release();
|
||||
|
||||
D3DDEVICE_CREATION_PARAMETERS param;
|
||||
pDevice->GetCreationParameters(¶m);
|
||||
|
||||
|
|
@ -75,6 +69,9 @@ void DX9_Hook::prepareForOverlay(IDirect3DDevice9 *pDevice)
|
|||
io.IniFilename = NULL;
|
||||
|
||||
ImGui_ImplDX9_Init(pDevice);
|
||||
|
||||
get_steam_client()->steam_overlay->CreateFonts();
|
||||
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
|
|
@ -83,9 +80,7 @@ void DX9_Hook::prepareForOverlay(IDirect3DDevice9 *pDevice)
|
|||
|
||||
ImGui::NewFrame();
|
||||
|
||||
get_steam_client()->steam_overlay->OverlayProc(PresentParameters.BackBufferWidth, PresentParameters.BackBufferHeight);
|
||||
|
||||
ImGui::EndFrame();
|
||||
get_steam_client()->steam_overlay->OverlayProc();
|
||||
|
||||
ImGui::Render();
|
||||
|
||||
|
|
|
|||
|
|
@ -67,9 +67,6 @@ void OpenGL_Hook::resetRenderState()
|
|||
void OpenGL_Hook::prepareForOverlay(HDC hDC)
|
||||
{
|
||||
HWND hWnd = WindowFromDC(hDC);
|
||||
RECT rect;
|
||||
|
||||
GetClientRect(hWnd, &rect);
|
||||
|
||||
if (hWnd != Windows_Hook::Inst()->GetGameHwnd())
|
||||
resetRenderState();
|
||||
|
|
@ -82,6 +79,8 @@ void OpenGL_Hook::prepareForOverlay(HDC hDC)
|
|||
|
||||
ImGui_ImplOpenGL3_Init();
|
||||
|
||||
get_steam_client()->steam_overlay->CreateFonts();
|
||||
|
||||
initialized = true;
|
||||
}
|
||||
ImGui_ImplOpenGL3_NewFrame();
|
||||
|
|
@ -89,9 +88,7 @@ void OpenGL_Hook::prepareForOverlay(HDC hDC)
|
|||
|
||||
ImGui::NewFrame();
|
||||
|
||||
get_steam_client()->steam_overlay->OverlayProc(rect.right, rect.bottom);
|
||||
|
||||
ImGui::EndFrame();
|
||||
get_steam_client()->steam_overlay->OverlayProc();
|
||||
|
||||
ImGui::Render();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue