diff --git a/Base.h b/Base.h index 2901e9a..e4eff32 100644 --- a/Base.h +++ b/Base.h @@ -7,7 +7,10 @@ class Base { // Crash if hr != S_OK. static void hr_check(HRESULT hr) { - if (hr == S_OK) return; + // Ignore the "occluded" state as a success + if (hr == DXGI_STATUS_OCCLUDED) return; + + if (hr == S_OK) return; while (true) __debugbreak(); } }; \ No newline at end of file diff --git a/D3D11Context.cpp b/D3D11Context.cpp index 783c6e0..4e0e21d 100644 --- a/D3D11Context.cpp +++ b/D3D11Context.cpp @@ -171,8 +171,8 @@ D3DContext::D3DContext(): deviceContext(nullptr), swapChain(nullptr) { } void D3DContext::reposition(const RECT& position) { - unsigned int width = position.right - position.left; - unsigned int height = position.bottom - position.top; + int width = position.right - position.left; + int height = position.bottom - position.top; lookForIntelOutput(position); @@ -190,7 +190,7 @@ void D3DContext::reposition(const RECT& position) { syncIntelOutput(); - // Discard outstanding queued presents and queue a frame with the new size ASAP. + // Discard outstanding queued presents and queue a frame with the new size ASAP. hr_check(swapChain->Present(0, DXGI_PRESENT_RESTART)); //Sleep(500); // Wait for a vblank to really make sure our frame with the new size is ready before diff --git a/D3D12Context.cpp b/D3D12Context.cpp index 1f9ffe9..d05f986 100644 --- a/D3D12Context.cpp +++ b/D3D12Context.cpp @@ -518,8 +518,8 @@ D3DContext::D3DContext(): swapChain(nullptr), descriptorHeap(nullptr) { } void D3DContext::reposition(const RECT& position) { - unsigned int width = position.right - position.left; - unsigned int height = position.bottom - position.top; + int width = position.right - position.left; + int height = position.bottom - position.top; lookForIntelOutput(position);