Destroy cubemaps with the scene.
This commit is contained in:
parent
7efd3bb160
commit
c1291c0412
|
@ -351,6 +351,11 @@ proc destroy*(self: Scene) =
|
||||||
self.shadow_maps.destroy()
|
self.shadow_maps.destroy()
|
||||||
for ubo in self.lighting_UBOs:
|
for ubo in self.lighting_UBOs:
|
||||||
ubo.destroy()
|
ubo.destroy()
|
||||||
|
if self.background_cubemap != nil:
|
||||||
|
self.background_cubemap.destroy()
|
||||||
|
for cube in self.cubemaps:
|
||||||
|
cube.destroy()
|
||||||
|
self.cubemaps = @[]
|
||||||
self.engine.scenes.del(self.name)
|
self.engine.scenes.del(self.name)
|
||||||
# bound textures can linger
|
# bound textures can linger
|
||||||
unbindAllTextures()
|
unbindAllTextures()
|
||||||
|
|
Loading…
Reference in a new issue