diff --git a/src/OpenTK/Platform/Egl/EglContext.cs b/src/OpenTK/Platform/Egl/EglContext.cs index b6cca8f9..2844686d 100644 --- a/src/OpenTK/Platform/Egl/EglContext.cs +++ b/src/OpenTK/Platform/Egl/EglContext.cs @@ -53,6 +53,8 @@ namespace OpenTK.Platform.Egl if (window == null) throw new ArgumentNullException("window"); + EglContext shared = GetSharedEglContext(sharedContext); + WindowInfo = window; // Select an EGLConfig that matches the desired mode. We cannot use the 'mode' @@ -216,6 +218,21 @@ namespace OpenTK.Platform.Egl } } + private EglContext GetSharedEglContext(IGraphicsContext sharedContext) + { + if (sharedContext == null) + { + return null; + } + + var internalContext = sharedContext as IGraphicsContextInternal; + if (internalContext != null) + { + return (EglContext) internalContext.Implementation; + } + return (EglContext) sharedContext; + } + #endregion } }