MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / QueryRefreshRateForWindow

Method QueryRefreshRateForWindow

common/WindowInfo.cpp:124–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122}
123
124std::optional<float> WindowInfo::QueryRefreshRateForWindow(const WindowInfo& wi)
125{
126 std::optional<float> ret;
127 if (wi.type != Type::Win32 || !wi.window_handle)
128 return ret;
129
130 // Try DWM first, then fall back to integer values.
131 const HWND hwnd = static_cast<HWND>(wi.window_handle);
132 ret = GetRefreshRateFromDisplayConfig(hwnd);
133 if (!ret.has_value())
134 {
135 ret = GetRefreshRateFromDWM(hwnd);
136 if (!ret.has_value())
137 ret = GetRefreshRateFromMonitor(hwnd);
138 }
139
140 return ret;
141}
142
143#elif defined(__APPLE__)
144

Callers

nothing calls this directly

Calls 4

GetRefreshRateFromDWMFunction · 0.85
GetRefreshRateFromXRandRFunction · 0.85

Tested by

no test coverage detected