From 30752ed36d4c8dd8cf85817834565071568075bf Mon Sep 17 00:00:00 2001 From: Armin Sander Date: Sat, 18 Mar 2017 14:06:27 +0100 Subject: [PATCH 1/2] ANGLE: keep the backbuffer size updated when the window resizes --- src/OpenTK/Platform/Egl/EglContext.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/OpenTK/Platform/Egl/EglContext.cs b/src/OpenTK/Platform/Egl/EglContext.cs index b6cca8f9..c45ad7b4 100644 --- a/src/OpenTK/Platform/Egl/EglContext.cs +++ b/src/OpenTK/Platform/Egl/EglContext.cs @@ -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 From 89e792ee478ce977353386db0faaec439065f4bc Mon Sep 17 00:00:00 2001 From: Armin Sander Date: Sun, 19 Mar 2017 15:28:26 +0100 Subject: [PATCH 2/2] be sure the current context is set before calling Egl.WaitClient() --- src/OpenTK/Platform/Egl/EglContext.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/OpenTK/Platform/Egl/EglContext.cs b/src/OpenTK/Platform/Egl/EglContext.cs index c45ad7b4..9b1639e5 100644 --- a/src/OpenTK/Platform/Egl/EglContext.cs +++ b/src/OpenTK/Platform/Egl/EglContext.cs @@ -173,6 +173,7 @@ namespace OpenTK.Platform.Egl public override void Update(IWindowInfo window) { + MakeCurrent(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.