app/internal/window: finish GL commands before resizing

Perhaps fixes flickering during window resize.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-11-06 11:23:49 +01:00
parent 6f3471e4ad
commit 8e874e1afd
+2 -2
View File
@@ -134,6 +134,8 @@ func (c *context) MakeCurrent() error {
if c.eglWin == win && width == c.width && height == c.height {
return nil
}
// Make sure any in-flight GL commands are complete.
c.c.Finish()
c.width, c.height = width, height
// Do not re-create surfaces when only resizing. This prevents flickering when resizing on X11.
if c.eglWin != win {
@@ -142,8 +144,6 @@ func (c *context) MakeCurrent() error {
c.srgbFBO = nil
}
if c.eglSurf != nilEGLSurface {
// Make sure any in-flight GL commands are complete.
c.c.Finish()
eglMakeCurrent(c.eglCtx.disp, nilEGLSurface, nilEGLSurface, nilEGLContext)
eglDestroySurface(c.eglCtx.disp, c.eglSurf)
c.eglSurf = nilEGLSurface