diff --git a/src/video/windows/SDL_windowsmodes.c b/src/video/windows/SDL_windowsmodes.c index 27771533bb..2f6a18b2d9 100644 --- a/src/video/windows/SDL_windowsmodes.c +++ b/src/video/windows/SDL_windowsmodes.c @@ -159,6 +159,19 @@ static SDL_DisplayOrientation WIN_GetDisplayOrientation(DEVMODE *mode) } } +static float WIN_GetRefreshRate(DEVMODE *mode) +{ + /* We're not currently using DXGI to query display modes, so fake NTSC timings */ + switch (mode->dmDisplayFrequency) { + case 119: + case 59: + case 29: + return ((100 * (mode->dmDisplayFrequency + 1) * 1000) / 1001) / 100.0f; + default: + return (float)mode->dmDisplayFrequency; + } +} + static SDL_bool WIN_GetDisplayMode(_THIS, LPCWSTR deviceName, DWORD index, SDL_DisplayMode *mode, SDL_DisplayOrientation *orientation) { SDL_DisplayModeData *data; @@ -181,7 +194,7 @@ static SDL_bool WIN_GetDisplayMode(_THIS, LPCWSTR deviceName, DWORD index, SDL_D mode->format = SDL_PIXELFORMAT_UNKNOWN; mode->w = data->DeviceMode.dmPelsWidth; mode->h = data->DeviceMode.dmPelsHeight; - mode->refresh_rate = (float)data->DeviceMode.dmDisplayFrequency; + mode->refresh_rate = WIN_GetRefreshRate(&data->DeviceMode); /* Fill in the mode information */ WIN_UpdateDisplayMode(_this, deviceName, index, mode);