From 6add995b06047ec604399807f0dd8c7c8f52bb93 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Wed, 18 Jan 2012 19:59:42 +0100 Subject: [PATCH 1/3] Formatting. --- src/x11_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/x11_init.c b/src/x11_init.c index 0d00b8ab..4d3c0f74 100644 --- a/src/x11_init.c +++ b/src/x11_init.c @@ -366,7 +366,7 @@ static void updateKeyCodeLUT(void) static GLboolean initDisplay(void) { - _glfwLibrary.X11.display = XOpenDisplay(0); + _glfwLibrary.X11.display = XOpenDisplay(NULL); if (!_glfwLibrary.X11.display) { _glfwSetError(GLFW_OPENGL_UNAVAILABLE, "X11/GLX: Failed to open X display"); From 1ca5391acdb3f9aba9564eed335d8228966cb79f Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Wed, 18 Jan 2012 21:12:34 +0100 Subject: [PATCH 2/3] Removed trailing whitespace. --- src/cocoa_gamma.m | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/cocoa_gamma.m b/src/cocoa_gamma.m index 4f21314a..92c9abb0 100644 --- a/src/cocoa_gamma.m +++ b/src/cocoa_gamma.m @@ -48,13 +48,13 @@ void _glfwPlatformGetGammaRamp(GLFWgammaramp* ramp) CGGammaValue red[GLFW_GAMMA_RAMP_SIZE]; CGGammaValue green[GLFW_GAMMA_RAMP_SIZE]; CGGammaValue blue[GLFW_GAMMA_RAMP_SIZE]; - + // For now, don't support anything that is not GLFW_GAMMA_RAMP_SIZE // i.e. 256. I don't think anyone would want to change the gamma on // Mac anyway... if (_glfwLibrary.originalRampSize != GLFW_GAMMA_RAMP_SIZE) return; - + CGGetDisplayTransferByTable(CGMainDisplayID(), GLFW_GAMMA_RAMP_SIZE, red, green, blue, &sampleCount); @@ -78,13 +78,13 @@ void _glfwPlatformSetGammaRamp(const GLFWgammaramp* ramp) CGGammaValue red[GLFW_GAMMA_RAMP_SIZE]; CGGammaValue green[GLFW_GAMMA_RAMP_SIZE]; CGGammaValue blue[GLFW_GAMMA_RAMP_SIZE]; - + // For now, don't support anything that is not GLFW_GAMMA_RAMP_SIZE // i.e. 256. I don't think anyone would want to change the gamma on // Mac anyway... if (_glfwLibrary.originalRampSize != GLFW_GAMMA_RAMP_SIZE) return; - + // Convert to float & take the difference of the original gamma and // the linear function. for (i = 0; i < size; i++) @@ -93,6 +93,7 @@ void _glfwPlatformSetGammaRamp(const GLFWgammaramp* ramp) green[i] = ramp->green[i] / 65535.f; blue[i] = ramp->blue[i] / 65535.f; } + CGSetDisplayTransferByTable(CGMainDisplayID(), GLFW_GAMMA_RAMP_SIZE, red, green, blue); } From 57f9602b0e04bc75c57bbead33139985daaec0b0 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Wed, 18 Jan 2012 21:13:06 +0100 Subject: [PATCH 3/3] Removed speculation. --- src/cocoa_gamma.m | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/cocoa_gamma.m b/src/cocoa_gamma.m index 92c9abb0..eb291082 100644 --- a/src/cocoa_gamma.m +++ b/src/cocoa_gamma.m @@ -50,8 +50,6 @@ void _glfwPlatformGetGammaRamp(GLFWgammaramp* ramp) CGGammaValue blue[GLFW_GAMMA_RAMP_SIZE]; // For now, don't support anything that is not GLFW_GAMMA_RAMP_SIZE - // i.e. 256. I don't think anyone would want to change the gamma on - // Mac anyway... if (_glfwLibrary.originalRampSize != GLFW_GAMMA_RAMP_SIZE) return; @@ -80,8 +78,6 @@ void _glfwPlatformSetGammaRamp(const GLFWgammaramp* ramp) CGGammaValue blue[GLFW_GAMMA_RAMP_SIZE]; // For now, don't support anything that is not GLFW_GAMMA_RAMP_SIZE - // i.e. 256. I don't think anyone would want to change the gamma on - // Mac anyway... if (_glfwLibrary.originalRampSize != GLFW_GAMMA_RAMP_SIZE) return;