From c5f51d1e5a29bc6fec7528bd4764e2a2971517c3 Mon Sep 17 00:00:00 2001 From: Colby Klein Date: Wed, 24 May 2017 03:37:25 -0700 Subject: [PATCH] Call DwmFlush on VSync (might help with stuttering). Note: Requires Windows Vista or later. --- src/archutils/Win32/GraphicsWindow.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/archutils/Win32/GraphicsWindow.cpp b/src/archutils/Win32/GraphicsWindow.cpp index f2eb90c54e..5722701ed2 100644 --- a/src/archutils/Win32/GraphicsWindow.cpp +++ b/src/archutils/Win32/GraphicsWindow.cpp @@ -12,6 +12,8 @@ #include "archutils/Win32/WindowIcon.h" #include "archutils/Win32/GetFileInformation.h" #include "CommandLineActions.h" +#include +#pragma comment(lib, "dwmapi.lib") #include @@ -495,6 +497,11 @@ void GraphicsWindow::Update() HOOKS->SetHasFocus( g_bHasFocus ); + if (g_CurrentParams.vsync) + { + DwmFlush(); + } + if( g_bResolutionChanged && DISPLAY != NULL ) { //LOG->Warn( "Changing resolution" );