mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
opengl: Bug fix: Reset lastTexture when deleting
This commit is contained in:
parent
69497aff41
commit
1b152ae771
@ -225,6 +225,9 @@ func (c *Context) DeleteTexture(t Texture) {
|
|||||||
if !gl.IsTexture(tt) {
|
if !gl.IsTexture(tt) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
if c.lastTexture == t {
|
||||||
|
c.lastTexture = invalidTexture
|
||||||
|
}
|
||||||
gl.DeleteTextures(1, &tt)
|
gl.DeleteTextures(1, &tt)
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
@ -199,6 +199,9 @@ func (c *Context) DeleteTexture(t Texture) {
|
|||||||
if !gl.IsTexture(t.Object) {
|
if !gl.IsTexture(t.Object) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if c.lastTexture == t {
|
||||||
|
c.lastTexture = invalidTexture
|
||||||
|
}
|
||||||
gl.DeleteTexture(t.Object)
|
gl.DeleteTexture(t.Object)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -173,6 +173,9 @@ func (c *Context) DeleteTexture(t Texture) {
|
|||||||
if !gl.IsTexture(mgl.Texture(t)) {
|
if !gl.IsTexture(mgl.Texture(t)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if c.lastTexture == t {
|
||||||
|
c.lastTexture = invalidTexture
|
||||||
|
}
|
||||||
gl.DeleteTexture(mgl.Texture(t))
|
gl.DeleteTexture(mgl.Texture(t))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user