mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-02-02 22:14:29 +01:00
opengl: Add IsContextLost
This commit is contained in:
parent
f8e589dd9c
commit
de987be85f
@ -180,7 +180,7 @@ func (i *Image) ReplacePixels(p []uint8) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (i *Image) IsInvalidated(context *opengl.Context) bool {
|
func (i *Image) IsInvalidated(context *opengl.Context) bool {
|
||||||
return !context.IsTexture(i.texture.native)
|
return context.IsContextLost(i.texture.native)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i *Image) createFramebufferIfNeeded(context *opengl.Context) (*framebuffer, error) {
|
func (i *Image) createFramebufferIfNeeded(context *opengl.Context) (*framebuffer, error) {
|
||||||
|
@ -514,3 +514,7 @@ func (c *Context) Flush() {
|
|||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *Context) IsContextLost(t Texture) bool {
|
||||||
|
return !c.IsTexture(t)
|
||||||
|
}
|
||||||
|
@ -407,3 +407,8 @@ func (c *Context) Flush() {
|
|||||||
gl := c.gl
|
gl := c.gl
|
||||||
gl.Flush()
|
gl.Flush()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *Context) IsContextLost(t Texture) bool {
|
||||||
|
gl := c.gl
|
||||||
|
return gl.IsContextLost()
|
||||||
|
}
|
||||||
|
@ -430,3 +430,7 @@ func (c *Context) Flush() {
|
|||||||
gl := c.gl
|
gl := c.gl
|
||||||
gl.Flush()
|
gl.Flush()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *Context) IsContextLost(t Texture) bool {
|
||||||
|
return !c.IsTexture(t)
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user