From 194e865bd6febf91d95561937077eae0ecd1b704 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Wed, 7 Sep 2011 05:41:40 +0200 Subject: [PATCH] Don't duplicate extension preference logic. --- src/x11_window.c | 35 +++++++++++------------------------ 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/src/x11_window.c b/src/x11_window.c index f70f343b..a05b121c 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -599,16 +599,13 @@ static void initGLXExtensions(_GLFWwindow* window) window->GLX.EXT_swap_control = GL_TRUE; } - if (!window->GLX.EXT_swap_control) + if (_glfwPlatformExtensionSupported("GLX_SGI_swap_control")) { - if (_glfwPlatformExtensionSupported("GLX_SGI_swap_control")) - { - window->GLX.SwapIntervalSGI = (PFNGLXSWAPINTERVALSGIPROC) - _glfwPlatformGetProcAddress("glXSwapIntervalSGI"); + window->GLX.SwapIntervalSGI = (PFNGLXSWAPINTERVALSGIPROC) + _glfwPlatformGetProcAddress("glXSwapIntervalSGI"); - if (window->GLX.SwapIntervalSGI) - window->GLX.SGI_swap_control = GL_TRUE; - } + if (window->GLX.SwapIntervalSGI) + window->GLX.SGI_swap_control = GL_TRUE; } if (_glfwPlatformExtensionSupported("GLX_SGIX_fbconfig")) @@ -643,24 +640,14 @@ static void initGLXExtensions(_GLFWwindow* window) window->GLX.ARB_create_context = GL_TRUE; } - if (window->GLX.ARB_create_context) - { - if (_glfwPlatformExtensionSupported("GLX_ARB_create_context_profile")) - window->GLX.ARB_create_context_profile = GL_TRUE; - } + if (_glfwPlatformExtensionSupported("GLX_ARB_create_context_robustness")) + window->GLX.ARB_create_context_robustness = GL_TRUE; - if (window->GLX.ARB_create_context && - window->GLX.ARB_create_context_profile) - { - if (_glfwPlatformExtensionSupported("GLX_EXT_create_context_es2_profile")) - window->GLX.EXT_create_context_es2_profile = GL_TRUE; - } + if (_glfwPlatformExtensionSupported("GLX_ARB_create_context_profile")) + window->GLX.ARB_create_context_profile = GL_TRUE; - if (window->GLX.ARB_create_context) - { - if (_glfwPlatformExtensionSupported("GLX_ARB_create_context_robustness")) - window->GLX.ARB_create_context_robustness = GL_TRUE; - } + if (_glfwPlatformExtensionSupported("GLX_EXT_create_context_es2_profile")) + window->GLX.EXT_create_context_es2_profile = GL_TRUE; }