mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58: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) {
|
||||
return nil
|
||||
}
|
||||
if c.lastTexture == t {
|
||||
c.lastTexture = invalidTexture
|
||||
}
|
||||
gl.DeleteTextures(1, &tt)
|
||||
return nil
|
||||
})
|
||||
|
@ -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)
|
||||
}
|
||||
|
||||
|
@ -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))
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user