diff --git a/src/OpenTK.GLWidget/GLWidget.cs b/src/OpenTK.GLWidget/GLWidget.cs index 54b6bd78..afe0ffe7 100644 --- a/src/OpenTK.GLWidget/GLWidget.cs +++ b/src/OpenTK.GLWidget/GLWidget.cs @@ -109,6 +109,22 @@ namespace OpenTK return true; } + + /// + protected override GLContext OnCreateContext() + { + var gdkGLContext = Window.CreateGlContext(); + + GetRequiredVersion(out var major, out var minor); + gdkGLContext.SetRequiredVersion(major, minor); + + gdkGLContext.DebugEnabled = GraphicsContextFlags.HasFlag(GraphicsContextFlags.Debug); + gdkGLContext.ForwardCompatible = GraphicsContextFlags.HasFlag(GraphicsContextFlags.ForwardCompatible); + + gdkGLContext.Realize(); + return gdkGLContext; + } + /// /// Destructs this object. ///