From 8c86515d048f129281059e31ba48fa9f3b188870 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Thu, 1 Oct 2020 22:09:47 -0300 Subject: [PATCH] Revert "Windows: reduce stuttering in windowed mode via DwmFlush" This reverts commit 5dd4a463beba7eb956f881b73f6d5572105768e3. --- CMakeLists.txt | 1 - src/modules/window/sdl/Window.cpp | 18 ------------------ 2 files changed, 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 92fb211da..b23a1835a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1741,7 +1741,6 @@ if(MSVC) set(LOVE_LINK_LIBRARIES ${LOVE_LINK_LIBRARIES} ws2_32.lib winmm.lib - dwmapi.lib ) set(LOVE_RC diff --git a/src/modules/window/sdl/Window.cpp b/src/modules/window/sdl/Window.cpp index be242eadf..81fccc233 100644 --- a/src/modules/window/sdl/Window.cpp +++ b/src/modules/window/sdl/Window.cpp @@ -44,8 +44,6 @@ #if defined(LOVE_WINDOWS) #include -#include -#include #elif defined(LOVE_MACOSX) #include "common/macosx.h" #endif @@ -1012,22 +1010,6 @@ bool Window::isMinimized() const void Window::swapBuffers() { SDL_GL_SwapWindow(window); - -#ifdef LOVE_WINDOWS - // https://github.com/love2d/love/issues/1628 - // DwmFlush helps avoid apparent stuttering in windowed mode on Windows. Be careful to only call it when - // the compositor may be active and non-adaptive vsync is enabled (it syncs to nearest refresh which stops the - // "adaptive" part of adaptive vsync). - // Calling it directly after vsync seems to have less chance of dropping a frame than directly before. - if (context != nullptr && (!settings.fullscreen || settings.fstype == FULLSCREEN_DESKTOP) && getVSync() > 0) - { - // Desktop composition is always enabled in Windows 8+. But DwmIsCompositionEnabled won't always return true... - // (see DwmIsCompositionEnabled docs). - BOOL compositionEnabled = IsWindows8OrGreater(); - if (compositionEnabled || (SUCCEEDED(DwmIsCompositionEnabled(&compositionEnabled)) && compositionEnabled)) - DwmFlush(); - } -#endif } bool Window::hasFocus() const