|
@@ -82,7 +82,19 @@ AZ_CVAR(uint32_t, r_width, 1920, nullptr, AZ::ConsoleFunctorFlags::DontReplicate
|
|
|
AZ_CVAR(uint32_t, r_height, 1080, nullptr, AZ::ConsoleFunctorFlags::DontReplicate, "Starting window height in pixels.");
|
|
|
AZ_CVAR(uint32_t, r_fullscreen, false, nullptr, AZ::ConsoleFunctorFlags::DontReplicate, "Starting fullscreen state.");
|
|
|
AZ_CVAR(uint32_t, r_resolutionMode, 0, nullptr, AZ::ConsoleFunctorFlags::DontReplicate, "0: render resolution same as window client area size, 1: render resolution use the values specified by r_width and r_height");
|
|
|
-AZ_CVAR(float, r_renderScale, 1.0f, nullptr, AZ::ConsoleFunctorFlags::DontReplicate, "Scale to apply to the window resolution.");
|
|
|
+
|
|
|
+void cvar_r_renderScale_Changed(const float& newRenderScale)
|
|
|
+{
|
|
|
+ AZ_Error("AtomBootstrap", newRenderScale > 0, "RenderScale should be greater than 0");
|
|
|
+ if (newRenderScale > 0)
|
|
|
+ {
|
|
|
+ AzFramework::WindowSize newSize =
|
|
|
+ AzFramework::WindowSize(static_cast<uint32_t>(r_width * newRenderScale), static_cast<uint32_t>(r_height * newRenderScale));
|
|
|
+ AzFramework::WindowRequestBus::Broadcast(&AzFramework::WindowRequestBus::Events::SetEnableCustomizedResolution, true);
|
|
|
+ AzFramework::WindowRequestBus::Broadcast(&AzFramework::WindowRequestBus::Events::SetRenderResolution, newSize);
|
|
|
+ }
|
|
|
+}
|
|
|
+AZ_CVAR(float, r_renderScale, 1.0f, cvar_r_renderScale_Changed, AZ::ConsoleFunctorFlags::DontReplicate, "Scale to apply to the window resolution.");
|
|
|
|
|
|
namespace AZ
|
|
|
{
|