From cac3fd18a0f4a01ae6094376baf7ec07c50200c0 Mon Sep 17 00:00:00 2001 From: SuperSodaSea Date: Tue, 20 Feb 2024 23:14:21 +0800 Subject: [PATCH] Update context.c --- src/context.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/context.c b/src/context.c index fabd50e2..fc9e0c96 100644 --- a/src/context.c +++ b/src/context.c @@ -321,14 +321,19 @@ const _GLFWfbconfig* _glfwChooseFBConfig(const _GLFWfbconfig* desired, // Least number of missing buffers is the most important heuristic, // then color buffer size match and lastly size match for other buffers - if ((accelerationMatch && !closestAccelerationMatch) || missing < leastMissing) + if (accelerationMatch && !closestAccelerationMatch) closest = current; - else if (missing == leastMissing) + else if (accelerationMatch == closestAccelerationMatch) { - if ((colorDiff < leastColorDiff) || - (colorDiff == leastColorDiff && extraDiff < leastExtraDiff)) - { + if (missing < leastMissing) closest = current; + else if (missing == leastMissing) + { + if ((colorDiff < leastColorDiff) || + (colorDiff == leastColorDiff && extraDiff < leastExtraDiff)) + { + closest = current; + } } }