Browse Source
Merge pull request #5283 from shartte/master
Default to EGL initialization if no options are provided and OS is at least Windows 8
pull/5322/head
Dan Walmsley
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
4 additions and
4 deletions
-
src/Windows/Avalonia.Win32/Win32GlManager.cs
|
|
|
@ -9,6 +9,8 @@ namespace Avalonia.Win32 |
|
|
|
{ |
|
|
|
static class Win32GlManager |
|
|
|
{ |
|
|
|
private static readonly Version Windows7 = new Version(6, 1); |
|
|
|
|
|
|
|
public static void Initialize() |
|
|
|
{ |
|
|
|
AvaloniaLocator.CurrentMutable.Bind<IPlatformOpenGlInterface>().ToLazy<IPlatformOpenGlInterface>(() => |
|
|
|
@ -20,13 +22,11 @@ namespace Avalonia.Win32 |
|
|
|
return wgl; |
|
|
|
} |
|
|
|
|
|
|
|
if (opts?.AllowEglInitialization == true || |
|
|
|
((!opts?.AllowEglInitialization.HasValue ?? false) && |
|
|
|
Win32Platform.WindowsVersion > new Version(6, 1))) |
|
|
|
if (opts?.AllowEglInitialization ?? Win32Platform.WindowsVersion > Windows7) |
|
|
|
{ |
|
|
|
var egl = EglPlatformOpenGlInterface.TryCreate(() => new AngleWin32EglDisplay()); |
|
|
|
|
|
|
|
if (egl is { } && |
|
|
|
if (egl != null && |
|
|
|
opts?.UseWindowsUIComposition == true) |
|
|
|
{ |
|
|
|
WinUICompositorConnection.TryCreateAndRegister(egl); |
|
|
|
|