Remove GLVersion properties, and use the underlying GLArea implementation.
authorJarl Gullberg <jarl.gullberg@gmail.com>
Fri, 15 Sep 2017 09:52:50 +0000 (11:52 +0200)
committerJarl Gullberg <jarl.gullberg@gmail.com>
Fri, 15 Sep 2017 09:52:50 +0000 (11:52 +0200)
src/OpenTK.GLWidget/GLWidget.cs

index db1833e03b36a7de7c93f0f319066633d247194a..f5ae59209983ac3108575eb4edee4400a3ef7a83 100644 (file)
@@ -64,16 +64,6 @@ namespace OpenTK
         /// </summary>
         public bool Stereo { get; set; }
 
-        /// <summary>
-        /// The major version of OpenGL to use.
-        /// </summary>
-        public int GlVersionMajor { get; set; }
-
-        /// <summary>
-        /// The minor version of OpenGL to use.
-        /// </summary>
-        public int GlVersionMinor { get; set; }
-
         /// <summary>
         /// The set <see cref="GraphicsContextFlags"/> for this widget.
         /// </summary>
@@ -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)