Switch to EnumDisplayModesEx

Use EnumDisplayModesEx instead of EnumDisplayModes. This might help
with issue #6.
This commit is contained in:
Stefanos A 2013-11-05 23:41:42 +01:00
parent a4f125f16e
commit 21a1ca8895
2 changed files with 5 additions and 1 deletions

View file

@ -926,6 +926,10 @@ namespace OpenTK.Platform.Windows
public static extern BOOL EnumDisplaySettingsEx([MarshalAs(UnmanagedType.LPTStr)] LPCTSTR lpszDeviceName, DisplayModeSettingsEnum iModeNum, public static extern BOOL EnumDisplaySettingsEx([MarshalAs(UnmanagedType.LPTStr)] LPCTSTR lpszDeviceName, DisplayModeSettingsEnum iModeNum,
[In, Out] DeviceMode lpDevMode, DWORD dwFlags); [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 #endregion
#region GetMonitorInfo #region GetMonitorInfo

View file

@ -134,7 +134,7 @@ namespace OpenTK.Platform.Windows
opentk_dev_available_res.Clear(); opentk_dev_available_res.Clear();
mode_count = 0; 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); VerifyMode(dev1, monitor_mode);