Beispiel #1
0
func (glRenderer *OpenglRenderer) DestroyCubeMap(cubeMap *renderer.CubeMap) {
	if !cubeMap.Loaded {
		return
	}
	gl.DeleteTextures(1, &cubeMap.Id)
	cubeMap.Loaded = false
}
Beispiel #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
		}
	}
}
Beispiel #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
		}
	}
}
Beispiel #4
0
func (t *Texture) DeleteTexture() {
	gl.DeleteTextures(1, &t.texture)
}