diff --git a/Siv3D/src/Siv3D-Platform/WindowsDesktop/Siv3D/Renderer/D3D11/SwapChain/D3D11SwapChain.cpp b/Siv3D/src/Siv3D-Platform/WindowsDesktop/Siv3D/Renderer/D3D11/SwapChain/D3D11SwapChain.cpp index c2b4f2f21..fad37a4e5 100644 --- a/Siv3D/src/Siv3D-Platform/WindowsDesktop/Siv3D/Renderer/D3D11/SwapChain/D3D11SwapChain.cpp +++ b/Siv3D/src/Siv3D-Platform/WindowsDesktop/Siv3D/Renderer/D3D11/SwapChain/D3D11SwapChain.cpp @@ -138,9 +138,6 @@ namespace s3d m_previousWindowBounds = windowBounds; } - //const bool vSync = (not m_targetFrameRateHz.has_value()) - // || ((30.0 <= m_targetFrameRateHz) && (AbsDiff(m_targetFrameRateHz.value(), m_displayFrequency) <= 3.0)); - return vSync ? presentVSync() : presentNonVSync(); } @@ -149,16 +146,6 @@ namespace s3d return m_displayFrequency; } - //void D3D11SwapChain::setTargetFrameRateHz(const Optional& targetFrameRateHz) - //{ - // m_targetFrameRateHz = targetFrameRateHz; - //} - - //const Optional& D3D11SwapChain::getTargetFrameRateHz() const noexcept - //{ - // return m_targetFrameRateHz; - //} - IDXGISwapChain1* D3D11SwapChain::getSwapChain1() const noexcept { return m_swapChain1.Get(); @@ -245,37 +232,6 @@ namespace s3d bool D3D11SwapChain::presentNonVSync() { - /* - const double targetRefreshRateHz = m_targetFrameRateHz.value(); - const double targetRefreshPeriodMillisec = (1000.0 / targetRefreshRateHz); - const double displayRefreshPeriodMillisec = detail::GetDisplayRefreshPeriodMillisec(); - - LARGE_INTEGER counter; - ::QueryPerformanceCounter(&counter); - - { - m_context->Flush(); - - double timeToSleepMillisec = 0.0; - ::timeBeginPeriod(1); - - do - { - ::QueryPerformanceCounter(&counter); - const double timeSinceFlipMillisec = detail::ToMillisec(counter.QuadPart - m_lastPresentTime); - - timeToSleepMillisec = (targetRefreshPeriodMillisec - timeSinceFlipMillisec); - - if (timeToSleepMillisec > 0.0) - { - ::Sleep(static_cast(timeToSleepMillisec)); - } - } while (timeToSleepMillisec > 0.5); - - ::timeEndPeriod(1); - } - */ - const UINT presentFlags = m_tearingSupport ? DXGI_PRESENT_ALLOW_TEARING : 0; const HRESULT hr = m_swapChain1->Present(0, presentFlags); @@ -294,8 +250,6 @@ namespace s3d return false; } - //m_lastPresentTime = counter.QuadPart; - return true; } } diff --git a/Siv3D/src/Siv3D-Platform/WindowsDesktop/Siv3D/Renderer/D3D11/SwapChain/D3D11SwapChain.hpp b/Siv3D/src/Siv3D-Platform/WindowsDesktop/Siv3D/Renderer/D3D11/SwapChain/D3D11SwapChain.hpp index f1b609f35..2e2e5ec42 100644 --- a/Siv3D/src/Siv3D-Platform/WindowsDesktop/Siv3D/Renderer/D3D11/SwapChain/D3D11SwapChain.hpp +++ b/Siv3D/src/Siv3D-Platform/WindowsDesktop/Siv3D/Renderer/D3D11/SwapChain/D3D11SwapChain.hpp @@ -59,11 +59,6 @@ namespace s3d [[nodiscard]] double getDisplayFrequency() const noexcept; - //void setTargetFrameRateHz(const Optional& targetFrameRateHz); - - //[[nodiscard]] - //const Optional& getTargetFrameRateHz() const noexcept; - [[nodiscard]] IDXGISwapChain1* getSwapChain1() const noexcept;