shouldContinue delegate while load scene

What it says on the tin: a place to discuss proposed new features.
Post Reply
Posts: 31
Joined: Wed Feb 02, 2011 9:58 am

shouldContinue delegate while load scene

Post by demetrius »

On iPhone and iPad it is easy to be killed by the system while running out of memory. It looks like a user plays his game and it is suddenly killed by the system.
So I`d like to utilize a method like

static MeshManager::setDelegate(MeshManagerDelegate* aDelegate);

to register a delegate to control mesh loading process

Code: Select all

class MeshManagerDelegate
virtual bool shouldCountinue() = 0;
So that iPhone or iPad programmers could control the memory usage and the mesh loading process could be interrupted without running out of memory.

User avatar
Posts: 833
Joined: Thu Apr 15, 2010 7:42 am
Location: Poznan, Poland
x 33

Re: shouldContinue delegate while load scene

Post by so0os »

When there's no memory for your mesh, you're screwed up anyways.
Sos Sosowski :)

Posts: 26
Joined: Sat Mar 27, 2010 12:38 pm
x 2

Re: shouldContinue delegate while load scene

Post by Sauce »

you can tell the ogre resourcemanager in advance how much memory you want it to use with ResourceManager::setMemoryBudget(), and it will automatically unload resources based on their priority.

Here's what the docs says about this method;
"If, when asked to load a new resource, the manager believes it will exceed this memory budget, it will temporarily unload a resource to make room for the new one. This unloading is not permanent and the Resource is not destroyed; it simply needs to be reloaded when next used."

This should suit your needs just fine if you set an appropriate budget. In order for this to be 100% fool-proof though, you will need to make sure all of your game's assets are loaded by ogre's resource system - including sound effects and other non-Ogre resources. Read here for info on creating custom resource types.

Post Reply