diff --git a/src/context.c b/src/context.c index 647a9942..b3c78e80 100644 --- a/src/context.c +++ b/src/context.c @@ -196,12 +196,6 @@ const _GLFWfbconfig* _glfwChooseFBConfig(const _GLFWfbconfig* desired, continue; } - if (desired->doublebuffer != current->doublebuffer) - { - // Double buffering is a hard constraint - continue; - } - // Count number of missing buffers { missing = 0; diff --git a/src/glx_context.c b/src/glx_context.c index fbbb8977..ec1adc75 100644 --- a/src/glx_context.c +++ b/src/glx_context.c @@ -92,6 +92,9 @@ static GLFWbool chooseGLXFBConfig(const _GLFWfbconfig* desired, continue; } + if (getGLXFBConfigAttrib(n, GLX_DOUBLEBUFFER) != desired->doublebuffer) + continue; + if (desired->transparent) { XVisualInfo* vi = glXGetVisualFromFBConfig(_glfw.x11.display, n); @@ -119,8 +122,6 @@ static GLFWbool chooseGLXFBConfig(const _GLFWfbconfig* desired, if (getGLXFBConfigAttrib(n, GLX_STEREO)) u->stereo = GLFW_TRUE; - if (getGLXFBConfigAttrib(n, GLX_DOUBLEBUFFER)) - u->doublebuffer = GLFW_TRUE; if (_glfw.glx.ARB_multisample) u->samples = getGLXFBConfigAttrib(n, GLX_SAMPLES); diff --git a/src/wgl_context.c b/src/wgl_context.c index b7d1c4d4..a76795d8 100644 --- a/src/wgl_context.c +++ b/src/wgl_context.c @@ -165,6 +165,9 @@ static int choosePixelFormat(_GLFWwindow* window, if (findAttribValue(WGL_ACCELERATION_ARB) == WGL_NO_ACCELERATION_ARB) continue; + if (findAttribValue(WGL_DOUBLE_BUFFER_ARB) != fbconfig->doublebuffer) + continue; + u->redBits = findAttribValue(WGL_RED_BITS_ARB); u->greenBits = findAttribValue(WGL_GREEN_BITS_ARB); u->blueBits = findAttribValue(WGL_BLUE_BITS_ARB); @@ -182,8 +185,6 @@ static int choosePixelFormat(_GLFWwindow* window, if (findAttribValue(WGL_STEREO_ARB)) u->stereo = GLFW_TRUE; - if (findAttribValue(WGL_DOUBLE_BUFFER_ARB)) - u->doublebuffer = GLFW_TRUE; if (_glfw.wgl.ARB_multisample) u->samples = findAttribValue(WGL_SAMPLES_ARB); @@ -239,6 +240,9 @@ static int choosePixelFormat(_GLFWwindow* window, if (pfd.iPixelType != PFD_TYPE_RGBA) continue; + if (!!(pfd.dwFlags & PFD_DOUBLEBUFFER) != fbconfig->doublebuffer) + continue; + u->redBits = pfd.cRedBits; u->greenBits = pfd.cGreenBits; u->blueBits = pfd.cBlueBits; @@ -256,8 +260,6 @@ static int choosePixelFormat(_GLFWwindow* window, if (pfd.dwFlags & PFD_STEREO) u->stereo = GLFW_TRUE; - if (pfd.dwFlags & PFD_DOUBLEBUFFER) - u->doublebuffer = GLFW_TRUE; } u->handle = pixelFormat;