From 5dc8afbb14e1fa8beb214b4fddc3e6aab896f337 Mon Sep 17 00:00:00 2001 From: RERASER <2641320887@qq.com> Date: Sat, 9 Nov 2024 10:22:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8d3d9ex=E7=9A=84flip=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/component/iidx/d3d9_proxy/device_ex.cpp | 2 +- src/client/component/iidx/d3d9_proxy/interface_ex.cpp | 4 ++++ src/client/main.cpp | 1 + src/client/std_include.hpp | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/client/component/iidx/d3d9_proxy/device_ex.cpp b/src/client/component/iidx/d3d9_proxy/device_ex.cpp index ba0afa5..a088264 100644 --- a/src/client/component/iidx/d3d9_proxy/device_ex.cpp +++ b/src/client/component/iidx/d3d9_proxy/device_ex.cpp @@ -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) diff --git a/src/client/component/iidx/d3d9_proxy/interface_ex.cpp b/src/client/component/iidx/d3d9_proxy/interface_ex.cpp index e1163df..63a7309 100644 --- a/src/client/component/iidx/d3d9_proxy/interface_ex.cpp +++ b/src/client/component/iidx/d3d9_proxy/interface_ex.cpp @@ -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) { diff --git a/src/client/main.cpp b/src/client/main.cpp index f22f43c..1bd5a5a 100644 --- a/src/client/main.cpp +++ b/src/client/main.cpp @@ -235,6 +235,7 @@ int main() } enable_high_qos(); + DwmEnableMMCSS(TRUE); try_set_game_environment(game); component_loader::create_components(game::environment::get_game()); diff --git a/src/client/std_include.hpp b/src/client/std_include.hpp index a9930f7..9ed4b2b 100644 --- a/src/client/std_include.hpp +++ b/src/client/std_include.hpp @@ -50,6 +50,7 @@ #include #include #include +#include // min and max is required by gdi, therefore NOMINMAX won't work #ifdef max