From c112804539695480171d48f57aaa394ff0c4ae2c Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Wed, 5 Nov 2014 00:33:43 +0100 Subject: [PATCH] Ignore deprecated attributes on OS X core. --- src/nsgl_context.m | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/src/nsgl_context.m b/src/nsgl_context.m index cbdf284d..406685b4 100644 --- a/src/nsgl_context.m +++ b/src/nsgl_context.m @@ -128,8 +128,28 @@ int _glfwCreateContext(_GLFWwindow* window, #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 if (ctxconfig->major > 2) + { ADD_ATTR2(NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core); + } + else #endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/ + { + if (fbconfig->auxBuffers != GLFW_DONT_CARE) + ADD_ATTR2(NSOpenGLPFAAuxBuffers, fbconfig->auxBuffers); + + if (fbconfig->accumRedBits != GLFW_DONT_CARE && + fbconfig->accumGreenBits != GLFW_DONT_CARE && + fbconfig->accumBlueBits != GLFW_DONT_CARE && + fbconfig->accumAlphaBits != GLFW_DONT_CARE) + { + const int accumBits = fbconfig->accumRedBits + + fbconfig->accumGreenBits + + fbconfig->accumBlueBits + + fbconfig->accumAlphaBits; + + ADD_ATTR2(NSOpenGLPFAAccumSize, accumBits); + } + } if (fbconfig->redBits != GLFW_DONT_CARE && fbconfig->greenBits != GLFW_DONT_CARE && @@ -157,22 +177,6 @@ int _glfwCreateContext(_GLFWwindow* window, if (fbconfig->stencilBits != GLFW_DONT_CARE) ADD_ATTR2(NSOpenGLPFAStencilSize, fbconfig->stencilBits); - if (fbconfig->accumRedBits != GLFW_DONT_CARE && - fbconfig->accumGreenBits != GLFW_DONT_CARE && - fbconfig->accumBlueBits != GLFW_DONT_CARE && - fbconfig->accumAlphaBits != GLFW_DONT_CARE) - { - const int accumBits = fbconfig->accumRedBits + - fbconfig->accumGreenBits + - fbconfig->accumBlueBits + - fbconfig->accumAlphaBits; - - ADD_ATTR2(NSOpenGLPFAAccumSize, accumBits); - } - - if (fbconfig->auxBuffers != GLFW_DONT_CARE) - ADD_ATTR2(NSOpenGLPFAAuxBuffers, fbconfig->auxBuffers); - if (fbconfig->stereo) ADD_ATTR(NSOpenGLPFAStereo);