Skip to content

Commit

Permalink
フレームレート制限の旧実装のコメントアウトを削除
Browse files Browse the repository at this point in the history
  • Loading branch information
m4saka committed Feb 20, 2024
1 parent da52430 commit 5b00015
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand All @@ -149,16 +146,6 @@ namespace s3d
return m_displayFrequency;
}

//void D3D11SwapChain::setTargetFrameRateHz(const Optional<double>& targetFrameRateHz)
//{
// m_targetFrameRateHz = targetFrameRateHz;
//}

//const Optional<double>& D3D11SwapChain::getTargetFrameRateHz() const noexcept
//{
// return m_targetFrameRateHz;
//}

IDXGISwapChain1* D3D11SwapChain::getSwapChain1() const noexcept
{
return m_swapChain1.Get();
Expand Down Expand Up @@ -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<int32>(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);

Expand All @@ -294,8 +250,6 @@ namespace s3d
return false;
}

//m_lastPresentTime = counter.QuadPart;

return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,6 @@ namespace s3d
[[nodiscard]]
double getDisplayFrequency() const noexcept;

//void setTargetFrameRateHz(const Optional<double>& targetFrameRateHz);

//[[nodiscard]]
//const Optional<double>& getTargetFrameRateHz() const noexcept;

[[nodiscard]]
IDXGISwapChain1* getSwapChain1() const noexcept;

Expand Down

0 comments on commit 5b00015

Please sign in to comment.