Browse Source

check windows 10 build number and set composition flag before create window is called.

tmp-winuicomp_with_manual_fbo
Dan Walmsley 6 years ago
parent
commit
fdb6848046
  1. 7
      src/Windows/Avalonia.Win32/WindowImpl.cs

7
src/Windows/Avalonia.Win32/WindowImpl.cs

@ -101,15 +101,16 @@ namespace Avalonia.Win32
}; };
_rendererLock = new ManagedDeferredRendererLock(); _rendererLock = new ManagedDeferredRendererLock();
_isUsingComposition = Win32Platform.WindowsVersion.Major >= 10 && Win32Platform.WindowsVersion.Build >= 14393 &&
Win32GlManager.EglFeature.Display is AngleWin32EglDisplay angleDisplay &&
angleDisplay.PlatformApi == AngleOptions.PlatformApi.DirectX11;
CreateWindow(); CreateWindow();
_framebuffer = new FramebufferManager(_hwnd); _framebuffer = new FramebufferManager(_hwnd);
if (Win32GlManager.EglFeature != null) if (Win32GlManager.EglFeature != null)
{ {
if (Win32Platform.WindowsVersion.Major >= 10 && if (_isUsingComposition)
Win32GlManager.EglFeature.Display is AngleWin32EglDisplay angleDisplay &&
angleDisplay.PlatformApi == AngleOptions.PlatformApi.DirectX11)
{ {
var cgl = new CompositionEglGlPlatformSurface(Win32GlManager.EglFeature.DeferredContext, this); var cgl = new CompositionEglGlPlatformSurface(Win32GlManager.EglFeature.DeferredContext, this);
cgl.AttachToCompositionTree(_hwnd); cgl.AttachToCompositionTree(_hwnd);

Loading…
Cancel
Save