55 lines
1.3 KiB
C#
55 lines
1.3 KiB
C#
using Avalonia;
|
|
|
|
namespace AvaloniaStaticLinkSmoke;
|
|
|
|
internal static class Program
|
|
{
|
|
[STAThread]
|
|
public static void Main(string[] args) => BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);
|
|
|
|
public static AppBuilder BuildAvaloniaApp()
|
|
{
|
|
var builder = AppBuilder.Configure<App>()
|
|
.UsePlatformDetect()
|
|
.LogToTrace();
|
|
|
|
if (OperatingSystem.IsWindows())
|
|
{
|
|
builder = builder.With(new Win32PlatformOptions
|
|
{
|
|
RenderingMode =
|
|
[
|
|
Win32RenderingMode.AngleEgl,
|
|
Win32RenderingMode.Software
|
|
]
|
|
});
|
|
}
|
|
|
|
if (OperatingSystem.IsLinux())
|
|
{
|
|
builder = builder.With(new X11PlatformOptions
|
|
{
|
|
RenderingMode =
|
|
[
|
|
X11RenderingMode.Glx,
|
|
X11RenderingMode.Software
|
|
]
|
|
});
|
|
}
|
|
|
|
if (OperatingSystem.IsMacOS())
|
|
{
|
|
builder = builder.With(new AvaloniaNativePlatformOptions
|
|
{
|
|
RenderingMode =
|
|
[
|
|
AvaloniaNativeRenderingMode.OpenGl,
|
|
AvaloniaNativeRenderingMode.Software
|
|
]
|
|
});
|
|
}
|
|
|
|
return builder;
|
|
}
|
|
}
|