ANGLE: keep the backbuffer size updated when the window resizes
authorArmin Sander <armin@replicator.org>
Sat, 18 Mar 2017 13:06:27 +0000 (14:06 +0100)
committerArmin Sander <armin@replicator.org>
Sat, 18 Mar 2017 13:25:34 +0000 (14:25 +0100)
src/OpenTK/Platform/Egl/EglContext.cs

index b6cca8f..c45ad7b 100644 (file)
@@ -171,6 +171,18 @@ namespace OpenTK.Platform.Egl
             }
         }
 
+        public override void Update(IWindowInfo window)
+        {
+            // ANGLE updates the width and height of the back buffer surfaces in the WaitClient function.
+            // So without this calling this function, the surface won't match the size of the window after it 
+            // was resized.
+            // https://bugs.chromium.org/p/angleproject/issues/detail?id=1438
+            if (!Egl.WaitClient())
+            {
+                Debug.Print("[Warning] Egl.WaitClient() failed. Error: {0}", Egl.GetError());
+            }
+        }
+
         #endregion
 
         #region IGraphicsContextInternal Members