opengl: Bug fix: Reset lastTexture when deleting

This commit is contained in:
Hajime Hoshi 2016-07-10 05:04:25 +09:00
parent 69497aff41
commit 1b152ae771
3 changed files with 9 additions and 0 deletions

View File

@ -225,6 +225,9 @@ func (c *Context) DeleteTexture(t Texture) {
if !gl.IsTexture(tt) {
return nil
}
if c.lastTexture == t {
c.lastTexture = invalidTexture
}
gl.DeleteTextures(1, &tt)
return nil
})

View File

@ -199,6 +199,9 @@ func (c *Context) DeleteTexture(t Texture) {
if !gl.IsTexture(t.Object) {
return
}
if c.lastTexture == t {
c.lastTexture = invalidTexture
}
gl.DeleteTexture(t.Object)
}

View File

@ -173,6 +173,9 @@ func (c *Context) DeleteTexture(t Texture) {
if !gl.IsTexture(mgl.Texture(t)) {
return
}
if c.lastTexture == t {
c.lastTexture = invalidTexture
}
gl.DeleteTexture(mgl.Texture(t))
}