Fixed memory leak: skybox textures are now freed in VRAM when deleting Skybox

This commit is contained in:
Elderme 2015-08-06 14:58:45 +02:00
parent 9ea3d4958a
commit 351be306e1
2 changed files with 9 additions and 1 deletions

View File

@ -328,6 +328,13 @@ Skybox::Skybox(const std::vector<video::ITexture *> &skybox_textures)
}
}
Skybox::~Skybox()
{
glDeleteTextures(1, &m_cube_map);
glDeleteTextures(1, &m_specular_probe);
}
// ----------------------------------------------------------------------------
void Skybox::render(const scene::ICameraSceneNode *camera) const
{

View File

@ -43,7 +43,8 @@ private:
public:
Skybox(const std::vector<irr::video::ITexture *> &skybox_textures);
~Skybox();
void render(const irr::scene::ICameraSceneNode *camera) const;
inline GLuint getSpecularProbe() const {return m_specular_probe; }