-
-
Save chamons/1eae64a2e5e10cbaf18b140e92ec4ca3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/CoreGraphics/CGDisplay.cs b/src/CoreGraphics/CGDisplay.cs | |
index 6bfad44f8..8fdef17be 100644 | |
--- a/src/CoreGraphics/CGDisplay.cs | |
+++ b/src/CoreGraphics/CGDisplay.cs | |
@@ -167,6 +167,23 @@ namespace CoreGraphics | |
public static int ShieldingWindowLevel { | |
get { return CGShieldingWindowLevel (); } | |
} | |
+ | |
+ [DllImport (Constants.CoreGraphicsLibrary)] | |
+ extern static IntPtr CGDisplayCopyDisplayMode (uint display); | |
+ | |
+ [DllImport (Constants.CoreGraphicsLibrary)] | |
+ extern static void CGDisplayModeRelease (IntPtr mode); | |
+ | |
+ [DllImport (Constants.CoreGraphicsLibrary)] | |
+ extern static double CGDisplayModeGetRefreshRate (IntPtr mode); | |
+ | |
+ public static double RefreshRate (int display) | |
+ { | |
+ IntPtr mode = CGDisplayCopyDisplayMode((uint)display); | |
+ double refreshRate = CGDisplayModeGetRefreshRate (mode); | |
+ CGDisplayModeRelease (mode); | |
+ return refreshRate; | |
+ } | |
#endif | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment