diff --git a/src/win32_gamma.c b/src/win32_gamma.c index 3ece6da0..05a65826 100644 --- a/src/win32_gamma.c +++ b/src/win32_gamma.c @@ -50,11 +50,11 @@ void _glfwPlatformGetGammaRamp(_GLFWmonitor* monitor, GLFWgammaramp* ramp) GetDeviceGammaRamp(dc, values); DeleteDC(dc); + _glfwAllocGammaRamp(ramp, 256); + memcpy(ramp->red, values + 0, 256 * sizeof(unsigned short)); memcpy(ramp->green, values + 256, 256 * sizeof(unsigned short)); memcpy(ramp->blue, values + 512, 256 * sizeof(unsigned short)); - - ramp->size = 256; } void _glfwPlatformSetGammaRamp(_GLFWmonitor* monitor, const GLFWgammaramp* ramp)