mirror of
https://github.com/glfw/glfw.git
synced 2026-09-21 16:44:11 +00:00
+2
-12
@@ -290,13 +290,8 @@ void _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp)
|
||||
{
|
||||
HDC dc;
|
||||
WORD values[768];
|
||||
DISPLAY_DEVICEW display;
|
||||
|
||||
ZeroMemory(&display, sizeof(DISPLAY_DEVICEW));
|
||||
display.cb = sizeof(DISPLAY_DEVICEW);
|
||||
EnumDisplayDevicesW(monitor->win32.name, 0, &display, 0);
|
||||
|
||||
dc = CreateDCW(L"DISPLAY", display.DeviceString, NULL, NULL);
|
||||
dc = CreateDCW(L"DISPLAY", monitor->win32.name, NULL, NULL);
|
||||
GetDeviceGammaRamp(dc, values);
|
||||
DeleteDC(dc);
|
||||
|
||||
@@ -311,7 +306,6 @@ void _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp)
|
||||
{
|
||||
HDC dc;
|
||||
WORD values[768];
|
||||
DISPLAY_DEVICE display;
|
||||
|
||||
if (ramp->size != 256)
|
||||
{
|
||||
@@ -324,11 +318,7 @@ void _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp)
|
||||
memcpy(values + 256, ramp->green, 256 * sizeof(unsigned short));
|
||||
memcpy(values + 512, ramp->blue, 256 * sizeof(unsigned short));
|
||||
|
||||
ZeroMemory(&display, sizeof(DISPLAY_DEVICEW));
|
||||
display.cb = sizeof(DISPLAY_DEVICEW);
|
||||
EnumDisplayDevicesW(monitor->win32.name, 0, &display, 0);
|
||||
|
||||
dc = CreateDCW(L"DISPLAY", display.DeviceString, NULL, NULL);
|
||||
dc = CreateDCW(L"DISPLAY", monitor->win32.name, NULL, NULL);
|
||||
SetDeviceGammaRamp(dc, values);
|
||||
DeleteDC(dc);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user