Address review feedback

Signed-off-by: nvsickle <nvsickle@amazon.com>
This commit is contained in:
nvsickle
2021-06-22 10:35:47 -07:00
parent dd20a598b2
commit 21dbe8b48f
8 changed files with 16 additions and 14 deletions
@@ -69,7 +69,7 @@ namespace AzFramework
//! Toggle the full screen state of the window.
virtual void ToggleFullScreenState() = 0;
//! Returns a scalar multiplier representing how dots-per-inch this window has, compared
//! Returns a scalar multiplier representing how many dots-per-inch this window has, compared
//! to a "standard" value of 96, the default for Windows in a DPI unaware setting. This can
//! be used to scale user interface elements to ensure legibility on high density displays.
virtual float GetDpiScaleFactor() const = 0;
@@ -65,8 +65,7 @@ namespace AzFramework
NativeWindowImpl_Win32::NativeWindowImpl_Win32()
{
// Attempt to load GetDpiForWindow from user32 at runtime, available on Windows 10+ versions >= 1607
auto user32module = LoadLibraryA("user32.dll");
if (user32module)
if (auto user32module = LoadLibraryA("user32.dll"))
{
m_getDpiFunction = reinterpret_cast<GetDpiForWindowType*>(GetProcAddress(user32module, "GetDpiForWindow"));
}
@@ -255,6 +254,7 @@ namespace AzFramework
{
const float newScaleFactor = nativeWindowImpl->GetDpiScaleFactor();
WindowNotificationBus::Event(nativeWindowImpl->GetWindowHandle(), &WindowNotificationBus::Events::OnDpiScaleFactorChanged, newScaleFactor);
break;
}
default:
return DefWindowProc(hWnd, message, wParam, lParam);