diff --git a/Source/OpenTK/Platform/Egl/EglContext.cs b/Source/OpenTK/Platform/Egl/EglContext.cs index 8893e239..39ad46a9 100644 --- a/Source/OpenTK/Platform/Egl/EglContext.cs +++ b/Source/OpenTK/Platform/Egl/EglContext.cs @@ -75,6 +75,17 @@ namespace OpenTK.Platform.Egl MakeCurrent(window); } + public EglContext(ContextHandle handle, EglWindowInfo window, IGraphicsContext sharedContext, + int major, int minor, GraphicsContextFlags flags) + { + if (handle == ContextHandle.Zero) + throw new ArgumentException("handle"); + if (window == null) + throw new ArgumentNullException("window"); + + Handle = handle; + } + #endregion #region IGraphicsContext Members diff --git a/Source/OpenTK/Platform/Egl/EglMacPlatformFactory.cs b/Source/OpenTK/Platform/Egl/EglMacPlatformFactory.cs index e79430d6..d369e0a2 100644 --- a/Source/OpenTK/Platform/Egl/EglMacPlatformFactory.cs +++ b/Source/OpenTK/Platform/Egl/EglMacPlatformFactory.cs @@ -39,5 +39,10 @@ namespace OpenTK.Platform.Egl { throw new NotImplementedException(); } + + public override IGraphicsContext CreateGLContext(ContextHandle handle, IWindowInfo window, IGraphicsContext shareContext, bool directRendering, int major, int minor, GraphicsContextFlags flags) + { + throw new NotImplementedException(); + } } } diff --git a/Source/OpenTK/Platform/Egl/EglWinPlatformFactory.cs b/Source/OpenTK/Platform/Egl/EglWinPlatformFactory.cs index 4f6bd283..6e518cb6 100644 --- a/Source/OpenTK/Platform/Egl/EglWinPlatformFactory.cs +++ b/Source/OpenTK/Platform/Egl/EglWinPlatformFactory.cs @@ -45,6 +45,14 @@ namespace OpenTK.Platform.Egl return new EglContext(mode, egl_win, shareContext, major, minor, flags); } + public override IGraphicsContext CreateGLContext(ContextHandle handle, IWindowInfo window, IGraphicsContext shareContext, bool directRendering, int major, int minor, GraphicsContextFlags flags) + { + WinWindowInfo win_win = (WinWindowInfo)window; + EGLDisplay egl_display = Egl.GetDisplay(EGLNativeDisplayType.Default); // Egl.GetDisplay(new EGLNativeDisplayType(win_win.DeviceContext)); + EglWindowInfo egl_win = new OpenTK.Platform.Egl.EglWindowInfo(win_win.WindowHandle, egl_display); + return new EglContext(handle, egl_win, shareContext, major, minor, flags); + } + public override IGraphicsMode CreateGraphicsMode() { return new EglGraphicsMode(); diff --git a/Source/OpenTK/Platform/Egl/EglX11PlatformFactory.cs b/Source/OpenTK/Platform/Egl/EglX11PlatformFactory.cs index 4f0f2f2c..40054c3d 100644 --- a/Source/OpenTK/Platform/Egl/EglX11PlatformFactory.cs +++ b/Source/OpenTK/Platform/Egl/EglX11PlatformFactory.cs @@ -41,5 +41,12 @@ namespace OpenTK.Platform.Egl EglWindowInfo egl_win = new OpenTK.Platform.Egl.EglWindowInfo(x11_win.WindowHandle, Egl.GetDisplay(new EGLNativeDisplayType(x11_win.Display))); return new EglContext(mode, egl_win, shareContext, major, minor, flags); } + + public override IGraphicsContext CreateGLContext(ContextHandle handle, IWindowInfo window, IGraphicsContext shareContext, bool directRendering, int major, int minor, GraphicsContextFlags flags) + { + X11WindowInfo x11_win = (X11WindowInfo)window; + EglWindowInfo egl_win = new OpenTK.Platform.Egl.EglWindowInfo(x11_win.WindowHandle, Egl.GetDisplay(new EGLNativeDisplayType(x11_win.Display))); + return new EglContext(handle, egl_win, shareContext, major, minor, flags); + } } }