From ffface8f9501d5b3a7a8d9b33a378afc6da06f14 Mon Sep 17 00:00:00 2001 From: Nikita Tsukanov Date: Mon, 23 Dec 2019 11:50:10 +0300 Subject: [PATCH] Fixed EGLDisplay initialization --- src/Avalonia.OpenGL/EglDisplay.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Avalonia.OpenGL/EglDisplay.cs b/src/Avalonia.OpenGL/EglDisplay.cs index f93bf7280c..8a81b2b584 100644 --- a/src/Avalonia.OpenGL/EglDisplay.cs +++ b/src/Avalonia.OpenGL/EglDisplay.cs @@ -121,9 +121,11 @@ namespace Avalonia.OpenGL _contextAttributes = cfg.Attributes; _surfaceType = surfaceType; Type = cfg.Type; + goto Found; } - } + } + Found: if (_contextAttributes == null) throw new OpenGlException("No suitable EGL config was found"); @@ -155,7 +157,6 @@ namespace Avalonia.OpenGL if (surf == IntPtr.Zero) throw OpenGlException.GetFormattedException("eglCreatePBufferSurface", _egl); var rv = new EglContext(this, _egl, ctx, new EglSurface(this, _egl, surf)); - rv.MakeCurrent(null); return rv; }