Enable error checking for debug contexts.
authorJarl Gullberg <jarl.gullberg@gmail.com>
Sun, 1 Oct 2017 18:16:45 +0000 (20:16 +0200)
committerJarl Gullberg <jarl.gullberg@gmail.com>
Sun, 1 Oct 2017 18:16:45 +0000 (20:16 +0200)
src/OpenTK.GLWidget/GLWidget.cs

index da6e580..a31b3da 100644 (file)
@@ -256,6 +256,11 @@ namespace OpenTK
             // Create a dummy context that will grab the GdkGLContext that is current on the thread
             _GraphicsContext = new GraphicsContext(ContextHandle.Zero, null);
 
+            if (GraphicsContextFlags.HasFlag(GraphicsContextFlags.Debug))
+            {
+                _GraphicsContext.ErrorChecking = true;
+            }
+
             if (GraphicsContext.ShareContexts)
             {
                 Interlocked.Increment(ref _GraphicsContextCount);