Example #1
0
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")
}
Example #2
0
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")
}
Example #3
0
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
}
Example #4
0
func (c *textureContext) destroy() {
	globalStats.textureContextCount.dec()
	gl.DeleteTexture(c.texture)
	c.texture = gl.Texture{}
}
Example #5
0
func (c *textureContext) destroy() {
	gl.DeleteTexture(c.texture)
	c.texture = gl.Texture{}
}