From 2999c5d4b8f2dbd5532378f9fd310f7b33e0ec8d Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Thu, 16 Sep 2010 05:02:21 +0200 Subject: [PATCH] Formatting and clarification. --- src/cocoa/cocoa_window.m | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/cocoa/cocoa_window.m b/src/cocoa/cocoa_window.m index b390e956..b89c3bd2 100644 --- a/src/cocoa/cocoa_window.m +++ b/src/cocoa/cocoa_window.m @@ -787,12 +787,16 @@ void _glfwPlatformRefreshWindowParams(void) forVirtualScreen:0]; window->alphaBits = value; - // It seems that the color size includes the size of the alpha channel [window->NSGL.pixelFormat getValues:&value forAttribute:NSOpenGLPFAColorSize forVirtualScreen:0]; - value -= window->alphaBits; - _glfwSplitBPP(value, &window->redBits, &window->greenBits, &window->blueBits); + + // It seems that the color size includes the size of the alpha channel so + // we subtract it before splitting + _glfwSplitBPP(value - window->alphaBits, + &window->redBits, + &window->greenBits, + &window->blueBits); [window->NSGL.pixelFormat getValues:&value forAttribute:NSOpenGLPFADepthSize @@ -807,9 +811,11 @@ void _glfwPlatformRefreshWindowParams(void) [window->NSGL.pixelFormat getValues:&value forAttribute:NSOpenGLPFAAccumSize forVirtualScreen:0]; - window->accumRedBits = value / 3; - window->accumGreenBits = value / 3; - window->accumBlueBits = value / 3; + + _glfwSplitBPP(value, + &window->accumRedBits, + &window->accumGreenBits, + &window->accumBlueBits); // TODO: Figure out what to set this value to window->accumAlphaBits = 0;