opengl: Add IsContextLost

This commit is contained in:
Hajime Hoshi 2017-01-20 02:20:41 +09:00
parent f8e589dd9c
commit de987be85f
4 changed files with 14 additions and 1 deletions

View File

@ -180,7 +180,7 @@ func (i *Image) ReplacePixels(p []uint8) error {
}
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) {

View File

@ -514,3 +514,7 @@ func (c *Context) Flush() {
return nil
})
}
func (c *Context) IsContextLost(t Texture) bool {
return !c.IsTexture(t)
}

View File

@ -407,3 +407,8 @@ func (c *Context) Flush() {
gl := c.gl
gl.Flush()
}
func (c *Context) IsContextLost(t Texture) bool {
gl := c.gl
return gl.IsContextLost()
}

View File

@ -430,3 +430,7 @@ func (c *Context) Flush() {
gl := c.gl
gl.Flush()
}
func (c *Context) IsContextLost(t Texture) bool {
return !c.IsTexture(t)
}