Add buffer flag selection.
authorJarl Gullberg <jarl.gullberg@gmail.com>
Fri, 15 Sep 2017 10:37:28 +0000 (12:37 +0200)
committerJarl Gullberg <jarl.gullberg@gmail.com>
Fri, 15 Sep 2017 10:37:28 +0000 (12:37 +0200)
src/OpenTK.GLWidget/GLWidget.cs

index f5ae592..62e74f8 100644 (file)
@@ -1,7 +1,7 @@
 using System;
 using System.Threading;
 using System.ComponentModel;
-
+using Gdk;
 using OpenTK.Graphics;
 using OpenTK.Platform;
 
@@ -104,8 +104,24 @@ namespace OpenTK
             Samples = graphicsMode.Samples;
             Stereo = graphicsMode.Stereo;
 
-            SetRequiredVersion(glVersionMajor, glVersionMinor);
             GraphicsContextFlags = graphicsContextFlags;
+
+            SetRequiredVersion(glVersionMajor, glVersionMinor);
+
+            if (graphicsMode.Depth > 0)
+            {
+                HasDepthBuffer = true;
+            }
+
+            if (graphicsMode.Stencil > 0)
+            {
+                HasStencilBuffer = true;
+            }
+
+            if (graphicsMode.ColorFormat.Alpha > 0)
+            {
+                HasAlpha = true;
+            }
         }
 
         /// <summary>