Connected monitor API with Cocoa mode setting.
This commit is contained in:
parent
4ab93ee155
commit
7049f73b7d
@ -146,7 +146,7 @@ GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, int* width, int* height, int*
|
|||||||
CFIndex count, i;
|
CFIndex count, i;
|
||||||
unsigned int leastSizeDiff = UINT_MAX;
|
unsigned int leastSizeDiff = UINT_MAX;
|
||||||
|
|
||||||
modes = CGDisplayCopyAllDisplayModes(CGMainDisplayID(), NULL);
|
modes = CGDisplayCopyAllDisplayModes(monitor->ns.displayID, NULL);
|
||||||
count = CFArrayGetCount(modes);
|
count = CFArrayGetCount(modes);
|
||||||
|
|
||||||
for (i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
@ -190,10 +190,10 @@ GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, int* width, int* height, int*
|
|||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
monitor->ns.previousMode = CGDisplayCopyDisplayMode(CGMainDisplayID());
|
monitor->ns.previousMode = CGDisplayCopyDisplayMode(monitor->ns.displayID);
|
||||||
|
|
||||||
CGDisplayCapture(CGMainDisplayID());
|
CGDisplayCapture(monitor->ns.displayID);
|
||||||
CGDisplaySetDisplayMode(CGMainDisplayID(), bestMode, NULL);
|
CGDisplaySetDisplayMode(monitor->ns.displayID, bestMode, NULL);
|
||||||
|
|
||||||
CFRelease(modes);
|
CFRelease(modes);
|
||||||
return GL_TRUE;
|
return GL_TRUE;
|
||||||
@ -206,8 +206,8 @@ GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, int* width, int* height, int*
|
|||||||
|
|
||||||
void _glfwRestoreVideoMode(_GLFWmonitor* monitor)
|
void _glfwRestoreVideoMode(_GLFWmonitor* monitor)
|
||||||
{
|
{
|
||||||
CGDisplaySetDisplayMode(CGMainDisplayID(), monitor->ns.previousMode, NULL);
|
CGDisplaySetDisplayMode(monitor->ns.displayID, monitor->ns.previousMode, NULL);
|
||||||
CGDisplayRelease(CGMainDisplayID());
|
CGDisplayRelease(monitor->ns.displayID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user