From 90ec2c79cecc7dd7b71a33ec46163f3cf4dfceed Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Tue, 30 May 2017 01:46:48 +0900 Subject: [PATCH] opengl: Bug fix: return error when error occurs --- internal/opengl/context_desktop.go | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/internal/opengl/context_desktop.go b/internal/opengl/context_desktop.go index a0694d1cf..8727c3856 100644 --- a/internal/opengl/context_desktop.go +++ b/internal/opengl/context_desktop.go @@ -95,7 +95,7 @@ func (c *Context) Reset() error { c.init = true return nil }); err != nil { - return nil + return err } c.locationCache = newLocationCache() c.lastTexture = invalidTexture @@ -103,21 +103,17 @@ func (c *Context) Reset() error { c.lastViewportWidth = 0 c.lastViewportHeight = 0 c.lastCompositeMode = CompositeModeUnknown - if err := c.runOnContextThread(func() error { + _ = c.runOnContextThread(func() error { gl.Enable(gl.BLEND) return nil - }); err != nil { - return err - } + }) c.BlendFunc(CompositeModeSourceOver) - if err := c.runOnContextThread(func() error { + _ = c.runOnContextThread(func() error { f := int32(0) gl.GetIntegerv(gl.FRAMEBUFFER_BINDING, &f) c.screenFramebuffer = Framebuffer(f) return nil - }); err != nil { - return err - } + }) return nil }