opengl: Bug fix: return error when error occurs

This commit is contained in:
Hajime Hoshi 2017-05-30 01:46:48 +09:00
parent a5f80c3716
commit 90ec2c79ce

View File

@ -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
}