Browse Source

Merge branch 'master' into devtools-style-list

pull/9402/head
AtomCrafty 4 years ago
committed by GitHub
parent
commit
bd94075c59
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      src/Avalonia.OpenGL/Egl/EglPlatformOpenGlInterface.cs

5
src/Avalonia.OpenGL/Egl/EglPlatformOpenGlInterface.cs

@ -44,10 +44,13 @@ namespace Avalonia.OpenGL.Egl
public IGlContext CreateContext() => Display.CreateContext(null); public IGlContext CreateContext() => Display.CreateContext(null);
public IGlContext CreateSharedContext() => Display.CreateContext(PrimaryEglContext); public IGlContext CreateSharedContext() => Display.CreateContext(PrimaryEglContext);
public EglSurface CreateWindowSurface(IntPtr window) public EglSurface CreateWindowSurface(IntPtr window)
{ {
if (window == IntPtr.Zero)
throw new OpenGlException($"Window {window} is invalid.");
using (PrimaryContext.MakeCurrent()) using (PrimaryContext.MakeCurrent())
{ {
var s = Display.EglInterface.CreateWindowSurface(Display.Handle, Display.Config, window, var s = Display.EglInterface.CreateWindowSurface(Display.Handle, Display.Config, window,

Loading…
Cancel
Save