mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-12-15 12:39:38 +00:00
Add option to enable or disable auto-scale
This commit is contained in:
@@ -1152,7 +1152,7 @@ void GpDisplayDriverD3D11::Run()
|
||||
|
||||
unsigned int desiredWidth = clientRect.right - clientRect.left;
|
||||
unsigned int desiredHeight = clientRect.bottom - clientRect.top;
|
||||
if (clientRect.right - clientRect.left != m_windowWidthPhysical || clientRect.bottom - clientRect.top != m_windowHeightPhysical)
|
||||
if (clientRect.right - clientRect.left != m_windowWidthPhysical || clientRect.bottom - clientRect.top != m_windowHeightPhysical || m_isResolutionResetDesired)
|
||||
{
|
||||
uint32_t prevWidthPhysical = m_windowWidthPhysical;
|
||||
uint32_t prevHeightPhysical = m_windowHeightPhysical;
|
||||
@@ -1177,6 +1177,7 @@ void GpDisplayDriverD3D11::Run()
|
||||
m_windowHeightVirtual = virtualHeight;
|
||||
m_pixelScaleX = pixelScaleX;
|
||||
m_pixelScaleY = pixelScaleY;
|
||||
m_isResolutionResetDesired = false;
|
||||
|
||||
if (GpVOSEvent *resizeEvent = m_properties.m_eventQueue->QueueEvent())
|
||||
{
|
||||
@@ -1422,6 +1423,11 @@ void GpDisplayDriverD3D11::RequestToggleFullScreen(uint32_t timestamp)
|
||||
}
|
||||
}
|
||||
|
||||
void GpDisplayDriverD3D11::RequestResetVirtualResolution()
|
||||
{
|
||||
m_isResolutionResetDesired = true;
|
||||
}
|
||||
|
||||
const GpDisplayDriverProperties &GpDisplayDriverD3D11::GetProperties() const
|
||||
{
|
||||
return m_properties;
|
||||
@@ -1454,6 +1460,7 @@ GpDisplayDriverD3D11::GpDisplayDriverD3D11(const GpDisplayDriverProperties &prop
|
||||
, m_mouseIsInClientArea(false)
|
||||
, m_isFullScreen(false)
|
||||
, m_isFullScreenDesired(false)
|
||||
, m_isResolutionResetDesired(false)
|
||||
, m_lastFullScreenToggleTimeStamp(0)
|
||||
{
|
||||
memset(&m_syncTimeBase, 0, sizeof(m_syncTimeBase));
|
||||
|
||||
@@ -50,6 +50,7 @@ public:
|
||||
void SetBackgroundColor(uint8_t r, uint8_t g, uint8_t b, uint8_t a) override;
|
||||
|
||||
void RequestToggleFullScreen(uint32_t timestamp) override;
|
||||
void RequestResetVirtualResolution() override;
|
||||
|
||||
const GpDisplayDriverProperties &GetProperties() const override;
|
||||
|
||||
@@ -146,6 +147,7 @@ private:
|
||||
|
||||
bool m_isFullScreen;
|
||||
bool m_isFullScreenDesired;
|
||||
bool m_isResolutionResetDesired;
|
||||
RECT m_windowModeRevertRect;
|
||||
uint32_t m_lastFullScreenToggleTimeStamp;
|
||||
|
||||
@@ -154,7 +156,7 @@ private:
|
||||
|
||||
DWORD m_windowWidthPhysical; // Physical resolution is the resolution of the actual window
|
||||
DWORD m_windowHeightPhysical;
|
||||
DWORD m_windowWidthVirtual; // Virtual resolution is the resolution reported to teh game
|
||||
DWORD m_windowWidthVirtual; // Virtual resolution is the resolution reported to the game
|
||||
DWORD m_windowHeightVirtual;
|
||||
float m_pixelScaleX;
|
||||
float m_pixelScaleY;
|
||||
|
||||
Reference in New Issue
Block a user