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