From 0b8a5cb38c44b310bf056a337383048623e5e35c Mon Sep 17 00:00:00 2001 From: elasota Date: Sun, 17 May 2020 19:55:16 -0400 Subject: [PATCH] Fixed resolution changed event using physical resolution instead of virtual --- GpDisplayDriver_D3D11/GpDisplayDriverD3D11.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/GpDisplayDriver_D3D11/GpDisplayDriverD3D11.cpp b/GpDisplayDriver_D3D11/GpDisplayDriverD3D11.cpp index 3fe7cfb..4b1846c 100644 --- a/GpDisplayDriver_D3D11/GpDisplayDriverD3D11.cpp +++ b/GpDisplayDriver_D3D11/GpDisplayDriverD3D11.cpp @@ -959,8 +959,10 @@ void GpDisplayDriverD3D11::Run() unsigned int desiredHeight = clientRect.bottom - clientRect.top; if (clientRect.right - clientRect.left != m_windowWidthPhysical || clientRect.bottom - clientRect.top != m_windowHeightPhysical) { - uint32_t prevWidth = m_windowWidthPhysical; - uint32_t prevHeight = m_windowHeightPhysical; + uint32_t prevWidthPhysical = m_windowWidthPhysical; + uint32_t prevHeightPhysical = m_windowHeightPhysical; + uint32_t prevWidthVirtual = m_windowWidthVirtual; + uint32_t prevHeightVirtual = m_windowHeightVirtual; uint32_t virtualWidth = m_windowWidthVirtual; uint32_t virtualHeight = m_windowHeightVirtual; float pixelScaleX = 1.0f; @@ -984,8 +986,8 @@ void GpDisplayDriverD3D11::Run() if (GpVOSEvent *resizeEvent = m_properties.m_eventQueue->QueueEvent()) { resizeEvent->m_eventType = GpVOSEventTypes::kVideoResolutionChanged; - resizeEvent->m_event.m_resolutionChangedEvent.m_prevWidth = prevWidth; - resizeEvent->m_event.m_resolutionChangedEvent.m_prevHeight = prevHeight; + resizeEvent->m_event.m_resolutionChangedEvent.m_prevWidth = prevWidthVirtual; + resizeEvent->m_event.m_resolutionChangedEvent.m_prevHeight = prevHeightVirtual; resizeEvent->m_event.m_resolutionChangedEvent.m_newWidth = m_windowWidthVirtual; resizeEvent->m_event.m_resolutionChangedEvent.m_newHeight = m_windowHeightVirtual; }