func (glRenderer *OpenglRenderer) DestroyCubeMap(cubeMap *renderer.CubeMap) { if !cubeMap.Loaded { return } gl.DeleteTextures(1, &cubeMap.Id) cubeMap.Loaded = false }
func (glRenderer *OpenglRenderer) DestroyMaterial(material *renderer.Material) { for _, tex := range material.Textures { if tex.Loaded { gl.DeleteTextures(1, &tex.TextureId) tex.Loaded = false } } }
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 } } }
func (t *Texture) DeleteTexture() { gl.DeleteTextures(1, &t.texture) }