opengl: Bug fix: Reset viewport when framebuffer delation

This commit is contained in:
Hajime Hoshi 2016-06-05 08:16:16 +09:00
parent 12904d168d
commit 26ef56232b
2 changed files with 4 additions and 0 deletions

View File

@ -254,6 +254,8 @@ func (c *Context) DeleteFramebuffer(f Framebuffer) {
// https://www.khronos.org/opengles/sdk/docs/man/xhtml/glDeleteFramebuffers.xml
if c.lastFramebuffer == f {
c.lastFramebuffer = ZeroFramebuffer
c.lastViewportWidth = 0
c.lastViewportHeight = 0
}
gl.DeleteFramebuffers(1, &ff)
return nil

View File

@ -230,6 +230,8 @@ func (c *Context) DeleteFramebuffer(f Framebuffer) {
// https://www.khronos.org/opengles/sdk/docs/man/xhtml/glDeleteFramebuffers.xml
if c.lastFramebuffer == f {
c.lastFramebuffer = ZeroFramebuffer
c.lastViewportWidth = 0
c.lastViewportHeight = 0
}
gl.DeleteFramebuffer(f.Object)
}