Esempio n. 1
0
func (glRenderer *OpenglRenderer) DestroyCubeMap(cubeMap *renderer.CubeMap) {
	if !cubeMap.Loaded {
		return
	}
	gl.DeleteTextures(1, &cubeMap.Id)
	cubeMap.Loaded = false
}
Esempio n. 2
0
func (glRenderer *OpenglRenderer) DestroyMaterial(material *renderer.Material) {
	for _, tex := range material.Textures {
		if tex.Loaded {
			gl.DeleteTextures(1, &tex.TextureId)
			tex.Loaded = false
		}
	}
}
Esempio n. 3
0
func (glRenderer *OpenglRenderer) DestroyPostEffects(shader *renderer.Shader) {
	for i, po := range glRenderer.postEffects {
		if po.shader == shader {
			gl.DeleteRenderbuffers(1, &po.dboId)
			gl.DeleteTextures(1, &po.textureId)
			gl.DeleteFramebuffers(1, &po.fboId)
			glRenderer.postEffects = append(glRenderer.postEffects[:i], glRenderer.postEffects[i+1:]...)
			break
		}
	}
}
Esempio n. 4
0
func (t *Texture) DeleteTexture() {
	gl.DeleteTextures(1, &t.texture)
}