Added minimal SystemEvents definition to allow compilation on mobile devices.

This commit is contained in:
the_fiddler 2011-12-08 00:14:36 +00:00
parent 41e0c65dcb
commit 1e739bb4ff
2 changed files with 14 additions and 2 deletions

View file

@ -2173,6 +2173,15 @@ namespace OpenTK
} }
#endregion #endregion
#region SystemEvents
sealed class SystemEvents
{
public static event EventHandler DisplaySettingsChanged;
}
#endregion
} }
// Need a different namespace to avoid clash with OpenTK.Graphics. // Need a different namespace to avoid clash with OpenTK.Graphics.

View file

@ -28,6 +28,9 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
#if !MINIMAL
using Microsoft.Win32;
#endif
namespace OpenTK.Platform.Windows namespace OpenTK.Platform.Windows
{ {
@ -40,7 +43,7 @@ namespace OpenTK.Platform.Windows
public WinDisplayDeviceDriver() public WinDisplayDeviceDriver()
{ {
RefreshDisplayDevices(); RefreshDisplayDevices();
Microsoft.Win32.SystemEvents.DisplaySettingsChanged += SystemEvents.DisplaySettingsChanged +=
HandleDisplaySettingsChanged; HandleDisplaySettingsChanged;
} }
@ -173,7 +176,7 @@ namespace OpenTK.Platform.Windows
~WinDisplayDeviceDriver() ~WinDisplayDeviceDriver()
{ {
Microsoft.Win32.SystemEvents.DisplaySettingsChanged -= SystemEvents.DisplaySettingsChanged -=
HandleDisplaySettingsChanged; HandleDisplaySettingsChanged;
} }