From f2c53b9735949f083c410680a98508ada52ea1ff Mon Sep 17 00:00:00 2001 From: Robert Krawczyk Date: Thu, 11 Mar 2021 07:40:59 +0100 Subject: [PATCH] Change PresentationInterval (V-Sync) option behavior to force it off: -1 = V-Sync forced off 0 = no change 1 = forced on --- d3d9ex/Context.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/d3d9ex/Context.cpp b/d3d9ex/Context.cpp index 4333c6a..a1ab8c6 100644 --- a/d3d9ex/Context.cpp +++ b/d3d9ex/Context.cpp @@ -145,10 +145,14 @@ bool MainContext::ApplyPresentationParameters(D3DPRESENT_PARAMETERS* pPresentati PrintLog("MultiSampleType %u, MultiSampleQuality %u", pPresentationParameters->MultiSampleType, pPresentationParameters->MultiSampleQuality); } - if (config.GetOptionsPresentationInterval() != -1) + if (config.GetOptionsPresentationInterval() != 0) { - pPresentationParameters->PresentationInterval = config.GetOptionsPresentationInterval(); - PrintLog("PresentationInterval: PresentationInterval set to %u", pPresentationParameters->PresentationInterval); + if (config.GetOptionsPresentationInterval() == -1) + pPresentationParameters->PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; + else if (config.GetOptionsPresentationInterval() > 0) + pPresentationParameters->PresentationInterval = D3DPRESENT_INTERVAL_ONE; + + PrintLog("PresentationInterval: PresentationInterval set to 0x%x", pPresentationParameters->PresentationInterval); } if (config.GetOptionsSwapEffect() != -1)