From 85bcd1fa0cb5dbdd56acdb0c74a3e63abc74def4 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Wed, 13 Oct 2010 22:42:31 +0200 Subject: [PATCH] Renamed internal gamma function. --- src/internal.h | 2 +- src/x11/x11_gamma.c | 14 +++++++------- src/x11/x11_init.c | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/internal.h b/src/internal.h index fb7fef90..ee4e92c5 100644 --- a/src/internal.h +++ b/src/internal.h @@ -262,7 +262,7 @@ int _glfwPlatformGetVideoModes(GLFWvidmode* list, int maxcount); void _glfwPlatformGetDesktopMode(GLFWvidmode* mode); // Gamma ramp -void _glfwPlatformSaveGammaRamp(void); +void _glfwPlatformGetGammaRamp(GLFWgammaramp* ramp); void _glfwPlatformSetGammaRamp(const GLFWgammaramp* ramp); // Joystick diff --git a/src/x11/x11_gamma.c b/src/x11/x11_gamma.c index 779859f3..265fb31b 100644 --- a/src/x11/x11_gamma.c +++ b/src/x11/x11_gamma.c @@ -41,7 +41,7 @@ // Save the original gamma ramp so that we can restore it later //======================================================================== -void _glfwPlatformSaveGammaRamp(void) +void _glfwPlatformGetGammaRamp(GLFWgammaramp* ramp) { if (_glfwLibrary.X11.XRandR.available && !_glfwLibrary.X11.XRandR.gammaBroken) @@ -55,9 +55,9 @@ void _glfwPlatformSaveGammaRamp(void) XRRCrtcGamma* gamma = XRRGetCrtcGamma(_glfwLibrary.X11.display, rr->crtcs[0]); - memcpy(_glfwLibrary.originalRamp.red, gamma->red, size); - memcpy(_glfwLibrary.originalRamp.green, gamma->green, size); - memcpy(_glfwLibrary.originalRamp.blue, gamma->blue, size); + memcpy(ramp->red, gamma->red, size); + memcpy(ramp->green, gamma->green, size); + memcpy(ramp->blue, gamma->blue, size); XRRFreeGamma(gamma); XRRFreeScreenResources(rr); @@ -69,9 +69,9 @@ void _glfwPlatformSaveGammaRamp(void) XF86VidModeGetGammaRamp(_glfwLibrary.X11.display, _glfwLibrary.X11.screen, GLFW_GAMMA_RAMP_SIZE, - _glfwLibrary.originalRamp.red, - _glfwLibrary.originalRamp.green, - _glfwLibrary.originalRamp.blue); + ramp->red, + ramp->green, + ramp->blue); #endif } } diff --git a/src/x11/x11_init.c b/src/x11/x11_init.c index b6529168..c287e6da 100644 --- a/src/x11/x11_init.c +++ b/src/x11/x11_init.c @@ -178,7 +178,7 @@ static void initGammaRamp(void) fprintf(stderr, "Gamma ramp setting unsupported\n"); // Save the original gamma ramp - _glfwPlatformSaveGammaRamp(); + _glfwPlatformGetGammaRamp(&_glfwLibrary.originalRamp); }