From 2990afc623485b5372908ec5fd22fc1ade904743 Mon Sep 17 00:00:00 2001 From: Cliff Smolinsky <40178962+kliffy542@users.noreply.github.com> Date: Tue, 19 Mar 2019 17:09:36 -0700 Subject: [PATCH] Do initialization better --- src/wgl_context.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/wgl_context.c b/src/wgl_context.c index 371afb243..969895b17 100644 --- a/src/wgl_context.c +++ b/src/wgl_context.c @@ -321,11 +321,8 @@ static void swapBuffersWGL(_GLFWwindow* window) { if (IsWindowsVistaOrGreater()) { - BOOL enabled = FALSE; - // DWM Composition is always enabled on Win8+ - if (IsWindows8OrGreater()) - enabled = TRUE; + BOOL enabled = IsWindows8OrGreater(); // HACK: Use DwmFlush when desktop composition is enabled if (enabled || @@ -351,11 +348,8 @@ static void swapIntervalWGL(int interval) { if (IsWindowsVistaOrGreater()) { - BOOL enabled = FALSE; - // DWM Composition is always enabled on Win8+ - if (IsWindows8OrGreater()) - enabled = TRUE; + BOOL enabled = IsWindows8OrGreater(); // HACK: Disable WGL swap interval when desktop composition is enabled to // avoid interfering with DWM vsync