diff --git a/Source/OpenTK/Platform/Windows/API.cs b/Source/OpenTK/Platform/Windows/API.cs index 21863680..85c576b8 100644 --- a/Source/OpenTK/Platform/Windows/API.cs +++ b/Source/OpenTK/Platform/Windows/API.cs @@ -926,6 +926,10 @@ namespace OpenTK.Platform.Windows public static extern BOOL EnumDisplaySettingsEx([MarshalAs(UnmanagedType.LPTStr)] LPCTSTR lpszDeviceName, DisplayModeSettingsEnum iModeNum, [In, Out] DeviceMode lpDevMode, DWORD dwFlags); + [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)] + public static extern BOOL EnumDisplaySettingsEx([MarshalAs(UnmanagedType.LPTStr)] LPCTSTR lpszDeviceName, DWORD iModeNum, + [In, Out] DeviceMode lpDevMode, DWORD dwFlags); + #endregion #region GetMonitorInfo diff --git a/Source/OpenTK/Platform/Windows/WinDisplayDevice.cs b/Source/OpenTK/Platform/Windows/WinDisplayDevice.cs index a22e1a56..a42b16d1 100644 --- a/Source/OpenTK/Platform/Windows/WinDisplayDevice.cs +++ b/Source/OpenTK/Platform/Windows/WinDisplayDevice.cs @@ -134,7 +134,7 @@ namespace OpenTK.Platform.Windows opentk_dev_available_res.Clear(); mode_count = 0; - while (Functions.EnumDisplaySettings(dev1.DeviceName.ToString(), mode_count++, monitor_mode)) + while (Functions.EnumDisplaySettingsEx(dev1.DeviceName.ToString(), mode_count++, monitor_mode, 0)) { VerifyMode(dev1, monitor_mode);