Skip to content

Commit

Permalink
enable GPU on windows and linux.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Walmsley committed Dec 11, 2018
1 parent 09417ce commit 1addcfb
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion WalletWasabi.Gui/Program.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using Avalonia;
using Avalonia.Gtk3;
using AvalonStudio.Shell;
using AvalonStudio.Shell.Extensibility.Platforms;
using NBitcoin;
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using WalletWasabi.Gui.ViewModels;
using WalletWasabi.Logging;
Expand Down Expand Up @@ -81,6 +83,29 @@ static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEv
Logger.LogWarning(e?.ExceptionObject as Exception, "UnhandledException");
}

private static AppBuilder BuildAvaloniaApp() => AppBuilder.Configure<App>().UsePlatformDetect().UseReactiveUI();
private static AppBuilder BuildAvaloniaApp()
{
var result = AppBuilder.Configure<App>();

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
result
.UseWin32()
.UseDirect2D1();
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
result.UseGtk3(new Gtk3PlatformOptions
{
UseDeferredRendering = true,
UseGpuAcceleration = true
}).UseSkia();
}
{
result.UsePlatformDetect();
}

return result;
}
}
}

0 comments on commit 1addcfb

Please sign in to comment.