mirror of
https://github.com/ZDoom/Raze.git
synced 2025-06-02 18:21:06 +00:00
- The interpolation code needs the current frame rate so it must be retrieved.
This commit is contained in:
parent
064a453b41
commit
f2cc7e3636
2 changed files with 21 additions and 0 deletions
|
@ -330,6 +330,22 @@ bool CallHook(FInputDevice *device, HWND hWnd, UINT message, WPARAM wParam, LPAR
|
|||
return device->WndProcHook(hWnd, message, wParam, lParam, result);
|
||||
}
|
||||
|
||||
void GetRefreshRate(HWND hWnd)
|
||||
{
|
||||
HMONITOR moni = MonitorFromWindow(hWnd, MONITOR_DEFAULTTONEAREST);
|
||||
MONITORINFOEXA moninf;
|
||||
moninf.cbSize = sizeof(moninf);
|
||||
if (GetMonitorInfoA(moni, (LPMONITORINFO)&moninf))
|
||||
{
|
||||
DEVMODEA dm;
|
||||
dm.dmSize = sizeof(DEVMODEA);
|
||||
if (EnumDisplaySettingsA(moninf.szDevice, ENUM_CURRENT_SETTINGS, &dm))
|
||||
{
|
||||
refreshfreq = dm.dmDisplayFrequency;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
LRESULT result;
|
||||
|
@ -417,6 +433,7 @@ LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
break;
|
||||
|
||||
case WM_SETFOCUS:
|
||||
GetRefreshRate(hWnd);
|
||||
I_CheckNativeMouse (false, false); // This cannot call the event handler. Doing it from here is unsafe.
|
||||
break;
|
||||
|
||||
|
@ -461,6 +478,8 @@ LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
break;
|
||||
|
||||
case WM_DISPLAYCHANGE:
|
||||
GetRefreshRate(hWnd);
|
||||
// fall through
|
||||
case WM_STYLECHANGED:
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue