From c485327da55c177d89fa6c5c2fc7474829449544 Mon Sep 17 00:00:00 2001 From: Jarl Gullberg Date: Fri, 15 Sep 2017 11:52:50 +0200 Subject: [PATCH] Remove GLVersion properties, and use the underlying GLArea implementation. --- src/OpenTK.GLWidget/GLWidget.cs | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/OpenTK.GLWidget/GLWidget.cs b/src/OpenTK.GLWidget/GLWidget.cs index db1833e0..f5ae5920 100644 --- a/src/OpenTK.GLWidget/GLWidget.cs +++ b/src/OpenTK.GLWidget/GLWidget.cs @@ -64,16 +64,6 @@ namespace OpenTK /// public bool Stereo { get; set; } - /// - /// The major version of OpenGL to use. - /// - public int GlVersionMajor { get; set; } - - /// - /// The minor version of OpenGL to use. - /// - public int GlVersionMinor { get; set; } - /// /// The set for this widget. /// @@ -114,8 +104,7 @@ namespace OpenTK Samples = graphicsMode.Samples; Stereo = graphicsMode.Stereo; - GlVersionMajor = glVersionMajor; - GlVersionMinor = glVersionMinor; + SetRequiredVersion(glVersionMajor, glVersionMinor); GraphicsContextFlags = graphicsContextFlags; } @@ -393,7 +382,8 @@ namespace OpenTK // Since the GDK context is already created and has been made current, we can retrieve its handle. var gdkContextHandle = Factory.Default.CreateGetCurrentGraphicsContext()(); - _GraphicsContext = new GraphicsContext(gdkContextHandle, _WindowInfo, null, GlVersionMajor, GlVersionMinor, GraphicsContextFlags); + GetRequiredVersion(out int glVersionMajor, out int glVersionMinor); + _GraphicsContext = new GraphicsContext(gdkContextHandle, _WindowInfo, null, glVersionMajor, glVersionMinor, GraphicsContextFlags); _GraphicsContext.MakeCurrent(_WindowInfo); if (GraphicsContext.ShareContexts)