aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavilla <davilla@4pi.com>2012-05-10 00:50:46 -0400
committerdavilla <davilla@4pi.com>2012-05-10 00:50:46 -0400
commit67de371b38e26af21b10c7e889699ee2df7c73f2 (patch)
treef46aa5618f4d0b7cc6bfb0a80b8279448e2c8271
parentda85867e59d0ebbc02360a0711ac3c362a6d0156 (diff)
[osx] replace depreciated CGDisplayCurrentMode
-rw-r--r--xbmc/windowing/osx/WinSystemOSX.mm15
1 files changed, 6 insertions, 9 deletions
diff --git a/xbmc/windowing/osx/WinSystemOSX.mm b/xbmc/windowing/osx/WinSystemOSX.mm
index 22a5672570..9320bb3826 100644
--- a/xbmc/windowing/osx/WinSystemOSX.mm
+++ b/xbmc/windowing/osx/WinSystemOSX.mm
@@ -1049,8 +1049,7 @@ void CWinSystemOSX::GetScreenResolution(int* w, int* h, double* fps, int screenI
// Figure out the screen size. (default to main screen)
if(screenIdx >= GetNumScreens())
return;
- CGDirectDisplayID display_id = GetDisplayID(screenIdx);
- CFDictionaryRef mode = CGDisplayCurrentMode(display_id);
+ CGDirectDisplayID display_id = (CGDirectDisplayID)GetDisplayID(screenIdx);
NSOpenGLContext* context = [NSOpenGLContext currentContext];
if (context)
@@ -1063,16 +1062,14 @@ void CWinSystemOSX::GetScreenResolution(int* w, int* h, double* fps, int screenI
NSWindow* window;
window = [view window];
if (window)
- {
display_id = GetDisplayIDFromScreen( [window screen] );
- mode = CGDisplayCurrentMode(display_id);
- }
}
}
-
- *w = GetDictionaryInt(mode, kCGDisplayWidth);
- *h = GetDictionaryInt(mode, kCGDisplayHeight);
- *fps = GetDictionaryDouble(mode, kCGDisplayRefreshRate);
+ CGDisplayModeRef mode = CGDisplayCopyDisplayMode(display_id);
+ *w = CGDisplayModeGetWidth(mode);
+ *h = CGDisplayModeGetHeight(mode);
+ *fps = CGDisplayModeGetRefreshRate(mode);
+ CGDisplayModeRelease(mode);
if ((int)*fps == 0)
{
// NOTE: The refresh rate will be REPORTED AS 0 for many DVI and notebook displays.