Free Textures From Memory on Runtime?

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
doctorzeus
Posts: 13
Joined: Sun Jan 12, 2014 3:39 pm

Free Textures From Memory on Runtime?

Post by doctorzeus »

Hello,

I am trying to optimize my code a bit, as currently I start with X amount of memory used my irrlicht when it starts.

However when I then want to load a new scene (I call clear() with the scenemanager every time before I load a new scene) and then load back to the previous scene, it seems to still be holding the memory still used in the previous scene..

I don't have any memory leaks as the amount of memory stays constant no matter how many times you switch between these two scenes, does the "clear()" method actually remove the textures and such from the memory as I would obviously like to keep the memory usage as low as possible?

Many Thanks

DoctorZeus
doctorzeus
Posts: 13
Joined: Sun Jan 12, 2014 3:39 pm

Re: Free Textures From Memory on Runtime?

Post by doctorzeus »

OK in answer to my own question ;P , clearing the scene does not remove the textures from the memory.

My Solution was to call "removeAllTextures()" before loading the scene, but as stated you need to make sure that no pointers are then pointing to nothing which I am after by simply clearing the scene.. :)
Post Reply