From ecb17655c8591a0c2110a40790bc424a7d101236 Mon Sep 17 00:00:00 2001 From: StringWeaver <55291103+StringWeaver@users.noreply.github.com> Date: Sun, 16 Nov 2025 08:05:01 +0800 Subject: [PATCH 1/2] fix(win): Windows Gaphics API frame rate capped at 60fps --- src/platform/windows/display_wgc.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/platform/windows/display_wgc.cpp b/src/platform/windows/display_wgc.cpp index e70720eb39d..148c5828746 100644 --- a/src/platform/windows/display_wgc.cpp +++ b/src/platform/windows/display_wgc.cpp @@ -137,6 +137,15 @@ namespace platf::dxgi { } catch (winrt::hresult_error &e) { BOOST_LOG(warning) << "Screen capture may not be fully supported on this device for this release of Windows: failed to disable border around capture area: [0x"sv << util::hex(e.code()).to_string_view() << ']'; } + try{ + if (winrt::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Capture.GraphicsCaptureSession", L"MinUpdateInterval")) { + capture_session.MinUpdateInterval(4ms); //250Hz + }else { + BOOST_LOG(warning) << "Can't set MinUpdateInterval on this version of Windows"; + } + }catch(winrt::hresult_error &e) { + BOOST_LOG(warning) << "Screen capture may be capped to 60fps on this device for this release of Windows: failed to set MinUpdateInterval: [0x"sv << util::hex(e.code()).to_string_view() << ']'; + } try { capture_session.StartCapture(); } catch (winrt::hresult_error &e) { From ca39a0f9f996f46cee290e7ecdd02b1830a2f3fc Mon Sep 17 00:00:00 2001 From: StringWeaver <55291103+StringWeaver@users.noreply.github.com> Date: Sun, 16 Nov 2025 12:13:54 +0800 Subject: [PATCH 2/2] code formatting --- src/platform/windows/display_wgc.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/platform/windows/display_wgc.cpp b/src/platform/windows/display_wgc.cpp index 148c5828746..15cab763708 100644 --- a/src/platform/windows/display_wgc.cpp +++ b/src/platform/windows/display_wgc.cpp @@ -137,13 +137,13 @@ namespace platf::dxgi { } catch (winrt::hresult_error &e) { BOOST_LOG(warning) << "Screen capture may not be fully supported on this device for this release of Windows: failed to disable border around capture area: [0x"sv << util::hex(e.code()).to_string_view() << ']'; } - try{ + try { if (winrt::ApiInformation::IsPropertyPresent(L"Windows.Graphics.Capture.GraphicsCaptureSession", L"MinUpdateInterval")) { - capture_session.MinUpdateInterval(4ms); //250Hz - }else { + capture_session.MinUpdateInterval(4ms); // 250Hz + } else { BOOST_LOG(warning) << "Can't set MinUpdateInterval on this version of Windows"; } - }catch(winrt::hresult_error &e) { + } catch (winrt::hresult_error &e) { BOOST_LOG(warning) << "Screen capture may be capped to 60fps on this device for this release of Windows: failed to set MinUpdateInterval: [0x"sv << util::hex(e.code()).to_string_view() << ']'; } try {