Exemplo n.º 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")
}
Exemplo n.º 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")
}
Exemplo n.º 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
}
Exemplo n.º 4
0
func (c *textureContext) destroy() {
	globalStats.textureContextCount.dec()
	gl.DeleteTexture(c.texture)
	c.texture = gl.Texture{}
}
Exemplo n.º 5
0
func (c *textureContext) destroy() {
	gl.DeleteTexture(c.texture)
	c.texture = gl.Texture{}
}