AvaloniaOpenTK/AvaloniaOpenTK/Program.cs
2025-01-14 23:11:13 -06:00

43 lines
1.4 KiB
C#

using Avalonia;
using System;
using System.Collections.ObjectModel;
namespace AvaloniaOpenTK;
sealed class Program
{
// Platform-specific options to be passed to AppBuilder.Configure.
private static Win32PlatformOptions _win32PlatformOptions = new()
{
RenderingMode = new Collection<Win32RenderingMode>() { Win32RenderingMode.Wgl }
};
private static X11PlatformOptions _x11PlatformOptions = new()
{
RenderingMode = new Collection<X11RenderingMode>() { X11RenderingMode.Egl },
WmClass = "AvaloniaOpenTKApp"
};
private static MacOSPlatformOptions _macOSPlatformOptions = new()
{
ShowInDock = true
};
// Initialization code. Don't use any Avalonia, third-party APIs or any
// SynchronizationContext-reliant code before AppMain is called: things aren't initialized
// yet and stuff might break.
[STAThread]
public static void Main(string[] args) => BuildAvaloniaApp()
.StartWithClassicDesktopLifetime(args);
// Avalonia configuration, don't remove; also used by visual designer.
public static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure<App>()
.UsePlatformDetect()
.WithInterFont()
.UseSkia()
.With(_win32PlatformOptions)
.With(_x11PlatformOptions)
.With(_macOSPlatformOptions)
.LogToTrace();
}