diff options
author | TSRBerry <20988865+TSRBerry@users.noreply.github.com> | 2022-11-30 23:34:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-30 23:34:25 +0100 |
commit | 3fb583c98c39da58f0752c652ca60be87ff1f566 (patch) | |
tree | 6be74e635521ca677f9bfb5d5847a4a3ee5e364b /Ryujinx.Ava/Program.cs | |
parent | d2686e0a5b4f8ce70cbbd5cfcb02434921580834 (diff) |
Avalonia: Clean up leftover RenderTimer & Fix minimum and initial window size (#3935)1.1.403
* ava: Cleanup RenderTimer
* ava: Remove ContentControl from RendererHost
* ava: Remove unused actual scale factor
* ava: Enable UseGpu for Linux
* ava: Set better initial size & Scale the window properly
* ava: Realign properties
* ava: Use explicit type & specify where the note applies
Diffstat (limited to 'Ryujinx.Ava/Program.cs')
-rw-r--r-- | Ryujinx.Ava/Program.cs | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/Ryujinx.Ava/Program.cs b/Ryujinx.Ava/Program.cs index a941302b..91040397 100644 --- a/Ryujinx.Ava/Program.cs +++ b/Ryujinx.Ava/Program.cs @@ -1,8 +1,5 @@ using ARMeilleure.Translation.PTC; using Avalonia; -using Avalonia.Rendering; -using Avalonia.Threading; -using Ryujinx.Ava.Ui.Controls; using Ryujinx.Ava.Ui.Windows; using Ryujinx.Common; using Ryujinx.Common.Configuration; @@ -23,18 +20,15 @@ namespace Ryujinx.Ava { internal class Program { - public static double WindowScaleFactor { get; set; } - public static double ActualScaleFactor { get; set; } - public static string Version { get; private set; } - public static string ConfigurationPath { get; private set; } - public static bool PreviewerDetached { get; private set; } - public static RenderTimer RenderTimer { get; private set; } + public static double WindowScaleFactor { get; set; } + public static string Version { get; private set; } + public static string ConfigurationPath { get; private set; } + public static bool PreviewerDetached { get; private set; } [DllImport("user32.dll", SetLastError = true)] public static extern int MessageBoxA(IntPtr hWnd, string text, string caption, uint type); private const uint MB_ICONWARNING = 0x30; - private const int BaseDpi = 96; public static void Main(string[] args) { @@ -49,11 +43,7 @@ namespace Ryujinx.Ava Initialize(args); - RenderTimer = new RenderTimer(); - BuildAvaloniaApp().StartWithClassicDesktopLifetime(args); - - RenderTimer.Dispose(); } public static AppBuilder BuildAvaloniaApp() @@ -65,7 +55,7 @@ namespace Ryujinx.Ava EnableMultiTouch = true, EnableIme = true, UseEGL = false, - UseGpu = false + UseGpu = true }) .With(new Win32PlatformOptions { @@ -75,12 +65,6 @@ namespace Ryujinx.Ava CompositionBackdropCornerRadius = 8.0f, }) .UseSkia() - .AfterSetup(_ => - { - AvaloniaLocator.CurrentMutable - .Bind<IRenderTimer>().ToConstant(RenderTimer) - .Bind<IRenderLoop>().ToConstant(new RenderLoop(RenderTimer, Dispatcher.UIThread)); - }) .LogToTrace(); } @@ -115,7 +99,6 @@ namespace Ryujinx.Ava ForceDpiAware.Windows(); WindowScaleFactor = ForceDpiAware.GetWindowScaleFactor(); - ActualScaleFactor = ForceDpiAware.GetActualScaleFactor() / BaseDpi; // Logging system information. PrintSystemInfo(); |