Madness I say.
This commit is contained in:
parent
fbb7334c5c
commit
6cf04176e9
|
@ -201,6 +201,14 @@ namespace til // Terminal Implementation Library. Also: "Today I Learned"
|
|||
THROW_HR_IF(E_ABORT, !base::MakeCheckedNum(height()).AssignIfValid(&ret));
|
||||
return ret;
|
||||
}
|
||||
|
||||
template <typename T, typename... Args>
|
||||
auto capture(T&& func, Args&&... args) -> decltype(func(args..., static_cast<RECT*>(nullptr))) {
|
||||
RECT r{};
|
||||
auto rv = func(std::forward<Args>(args)..., &r);
|
||||
*this = static_cast<rectangle>(r);
|
||||
return rv;
|
||||
}
|
||||
|
||||
constexpr point origin() const noexcept
|
||||
{
|
||||
|
|
|
@ -429,11 +429,7 @@ void DxEngine::_ComputePixelShaderSettings() noexcept
|
|||
{
|
||||
// use the HWND's dimensions for the swap chain dimensions.
|
||||
til::rectangle clientRect;
|
||||
{
|
||||
RECT rect = { 0 };
|
||||
RETURN_IF_WIN32_BOOL_FALSE(GetClientRect(_hwndTarget, &rect));
|
||||
clientRect = rect;
|
||||
}
|
||||
RETURN_IF_WIN32_BOOL_FALSE(clientRect.capture(&::GetClientRect, _hwndTarget));
|
||||
|
||||
SwapChainDesc.Width = clientRect.width<UINT>();
|
||||
SwapChainDesc.Height = clientRect.height<UINT>();
|
||||
|
|
Loading…
Reference in a new issue