Made gamma ramp functions per-monitor.

This commit is contained in:
Camilla Berglund
2013-02-12 13:50:41 +01:00
parent 20ccf0bc60
commit 92a71e07d3
12 changed files with 139 additions and 126 deletions
+22 -4
View File
@@ -36,13 +36,31 @@
////// GLFW platform API //////
//////////////////////////////////////////////////////////////////////////
void _glfwPlatformGetGammaRamp(GLFWgammaramp* ramp)
void _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp)
{
GetDeviceGammaRamp(GetDC(GetDesktopWindow()), (WORD*) ramp);
HDC dc;
DISPLAY_DEVICE display;
ZeroMemory(&display, sizeof(DISPLAY_DEVICE));
display.cb = sizeof(DISPLAY_DEVICE);
EnumDisplayDevices(monitor->win32.name, 0, &display, 0);
dc = CreateDC(L"DISPLAY", display.DeviceString, NULL, NULL);
GetDeviceGammaRamp(dc, (WORD*) ramp);
DeleteDC(dc);
}
void _glfwPlatformSetGammaRamp(const GLFWgammaramp* ramp)
void _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp)
{
SetDeviceGammaRamp(GetDC(GetDesktopWindow()), (WORD*) ramp);
HDC dc;
DISPLAY_DEVICE display;
ZeroMemory(&display, sizeof(DISPLAY_DEVICE));
display.cb = sizeof(DISPLAY_DEVICE);
EnumDisplayDevices(monitor->win32.name, 0, &display, 0);
dc = CreateDC(L"DISPLAY", display.DeviceString, NULL, NULL);
SetDeviceGammaRamp(dc, (WORD*) ramp);
DeleteDC(dc);
}