Game Development Community

Does popDialog free the UI images from memory?

by Sabbie · in Torque Game Builder · 12/19/2007 (5:21 am) · 2 replies

Well, the question is in the topic. If I unload my main menu with Canvas.popDialog(), will it unload the main menu images from the memory? And if not, would anyone know how to do unload them? preload and allowUnload doesn't seem to work for gui images.

#1
12/19/2007 (5:48 am)
Hi

It will unload from VRAM but not from RAM. What is stored in RAM is the datablock of the images. In order to control RAM usage you'll have to dynamically create and delete datablocks. However if you check your RAM with Task Manager on WindowsXP you will see it change or not depending on the RAM available because of the OS handling memory usage. On Windows Vista you will be able to see the memory usage better since the RAM handling is somewhat smarter.

The problem with writing this is that you cannot have datablocks.cs having your imageDatablocks. It will take some work and you'll probably need loading screens so your users know it is loading all the datablocks for a given scene, but it's worth it in terms of using RAM better.

I hope I understood the question well and the answer helps. :)
#2
12/19/2007 (6:35 am)
Hmm, okay. But does that work in the same way for normal images? Cause I am dynamically loading my images per level with a DynamicImageLoader found on the web. Looking at the Private Bytes in Process Explorer the game uses 90MB on startup, 133MB in a level and 110MB when I return to the main screen.

Also, is there a way to check what images are loaded into the memory at a given time?

I'm sorry for all the questions, but I'm fairly new to game building. We're building a game for a school project and we only had 10 weeks for the design document and now 10 weeks for the game building itself.