Skip to content

Commit

Permalink
使用d3d9ex的flip模式
Browse files Browse the repository at this point in the history
  • Loading branch information
RERASER committed Nov 9, 2024
1 parent fb3a700 commit 5dc8afb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/client/component/iidx/d3d9_proxy/device_ex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ HRESULT __stdcall d3d9ex_device_proxy::Reset(D3DPRESENT_PARAMETERS* pPresentatio

HRESULT __stdcall d3d9ex_device_proxy::Present(const RECT* pSourceRect, const RECT* pDestRect, HWND hDestWindowOverride, const RGNDATA* pDirtyRegion)
{
return device_->Present(pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion);
return device_->PresentEx(pSourceRect, pDestRect, NULL, NULL, D3DPRESENT_FORCEIMMEDIATE);
}

HRESULT __stdcall d3d9ex_device_proxy::GetBackBuffer(UINT iSwapChain, UINT iBackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface9** ppBackBuffer)
Expand Down
4 changes: 4 additions & 0 deletions src/client/component/iidx/d3d9_proxy/interface_ex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ HRESULT __stdcall d3d9ex_proxy::CreateDeviceEx(UINT Adapter, D3DDEVTYPE DeviceTy

pPresentationParameters->BackBufferWidth = iidx::custom_resolution::width();
pPresentationParameters->BackBufferHeight = iidx::custom_resolution::height();
pPresentationParameters->BackBufferCount = 2;
pPresentationParameters->PresentationInterval = 0;
pPresentationParameters->SwapEffect = D3DSWAPEFFECT_FLIPEX;


if (iidx::custom_resolution::mode() != 0)
{
Expand Down
1 change: 1 addition & 0 deletions src/client/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ int main()
}

enable_high_qos();
DwmEnableMMCSS(TRUE);
try_set_game_environment(game);

component_loader::create_components(game::environment::get_game());
Expand Down
1 change: 1 addition & 0 deletions src/client/std_include.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
#include <d3d9.h>
#include <d3d9on12.h>
#include <d3d12.h>
#include <dwmapi.h>

// min and max is required by gdi, therefore NOMINMAX won't work
#ifdef max
Expand Down

0 comments on commit 5dc8afb

Please sign in to comment.