From 7049f73b7d4624b015b5ad52d06b23b2e2d6ad60 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Thu, 3 Jan 2013 20:11:41 +0100 Subject: [PATCH] Connected monitor API with Cocoa mode setting. --- src/cocoa_monitor.m | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cocoa_monitor.m b/src/cocoa_monitor.m index 759b3c67..6f6bd405 100644 --- a/src/cocoa_monitor.m +++ b/src/cocoa_monitor.m @@ -146,7 +146,7 @@ GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, int* width, int* height, int* CFIndex count, i; unsigned int leastSizeDiff = UINT_MAX; - modes = CGDisplayCopyAllDisplayModes(CGMainDisplayID(), NULL); + modes = CGDisplayCopyAllDisplayModes(monitor->ns.displayID, NULL); count = CFArrayGetCount(modes); for (i = 0; i < count; i++) @@ -190,10 +190,10 @@ GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, int* width, int* height, int* return GL_FALSE; } - monitor->ns.previousMode = CGDisplayCopyDisplayMode(CGMainDisplayID()); + monitor->ns.previousMode = CGDisplayCopyDisplayMode(monitor->ns.displayID); - CGDisplayCapture(CGMainDisplayID()); - CGDisplaySetDisplayMode(CGMainDisplayID(), bestMode, NULL); + CGDisplayCapture(monitor->ns.displayID); + CGDisplaySetDisplayMode(monitor->ns.displayID, bestMode, NULL); CFRelease(modes); return GL_TRUE; @@ -206,8 +206,8 @@ GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, int* width, int* height, int* void _glfwRestoreVideoMode(_GLFWmonitor* monitor) { - CGDisplaySetDisplayMode(CGMainDisplayID(), monitor->ns.previousMode, NULL); - CGDisplayRelease(CGMainDisplayID()); + CGDisplaySetDisplayMode(monitor->ns.displayID, monitor->ns.previousMode, NULL); + CGDisplayRelease(monitor->ns.displayID); }