From e879b731454de8f286069bf0313cc028e8e7be06 Mon Sep 17 00:00:00 2001 From: Jarl Gullberg Date: Fri, 15 Sep 2017 12:37:28 +0200 Subject: [PATCH] Add buffer flag selection. --- src/OpenTK.GLWidget/GLWidget.cs | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/OpenTK.GLWidget/GLWidget.cs b/src/OpenTK.GLWidget/GLWidget.cs index f5ae5920..62e74f8d 100644 --- a/src/OpenTK.GLWidget/GLWidget.cs +++ b/src/OpenTK.GLWidget/GLWidget.cs @@ -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; + } } ///