From 6f86b6fdbef655c9c9959bb421d6cf1ba4187330 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 29 Feb 2020 22:47:08 -0800 Subject: [PATCH] D3D11: Respect vsync setting. Fixes #12493. --- Windows/GPU/D3D11Context.cpp | 4 ++-- Windows/GPU/D3D11Context.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Windows/GPU/D3D11Context.cpp b/Windows/GPU/D3D11Context.cpp index c8911e5144..31b3bcb086 100644 --- a/Windows/GPU/D3D11Context.cpp +++ b/Windows/GPU/D3D11Context.cpp @@ -42,12 +42,12 @@ D3D11Context::~D3D11Context() { } void D3D11Context::SwapBuffers() { - swapChain_->Present(0, 0); + swapChain_->Present(swapInterval_, 0); draw_->HandleEvent(Draw::Event::PRESENTED, 0, 0, nullptr, nullptr); } void D3D11Context::SwapInterval(int interval) { - // Dummy + swapInterval_ = interval; } HRESULT D3D11Context::CreateTheDevice(IDXGIAdapter *adapter) { diff --git a/Windows/GPU/D3D11Context.h b/Windows/GPU/D3D11Context.h index 88f1547295..07d551b7de 100644 --- a/Windows/GPU/D3D11Context.h +++ b/Windows/GPU/D3D11Context.h @@ -67,4 +67,5 @@ private: HMODULE hD3D11; int width; int height; + int swapInterval_ = 0; };