func (c *glContext) deleteTexture(id int) error { tex := c.findTexture(id) if tex != nil && (tex.flags&ImageNoDelete) == 0 { gl.DeleteTexture(tex.tex) tex.id = 0 return nil } return errors.New("can't find texture") }
func (p *glParams) renderDeleteTexture(id int) error { tex := p.context.findTexture(id) if tex.tex.Valid() && (tex.flags&ImageNoDelete) == 0 { gl.DeleteTexture(tex.tex) tex.id = 0 tex.tex = gl.Texture{} return nil } return errors.New("invalid texture in GLParams.deleteTexture") }
func (p *glParams) renderDelete() { c := p.context c.shader.deleteShader() if c.vertexBuffer.Valid() { gl.DeleteBuffer(c.vertexBuffer) } for _, texture := range c.textures { if texture.tex.Valid() && (texture.flags&ImageNoDelete) == 0 { gl.DeleteTexture(texture.tex) } } p.context = nil }
func (c *textureContext) destroy() { globalStats.textureContextCount.dec() gl.DeleteTexture(c.texture) c.texture = gl.Texture{} }
func (c *textureContext) destroy() { gl.DeleteTexture(c.texture) c.texture = gl.Texture{} }