shouldContinue delegate while load scene

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

shouldContinue delegate while load scene

Post by demetrius » Sun Mar 06, 2011 3:33 pm

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
{
public:
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.
0 x

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

Re: shouldContinue delegate while load scene

Post by so0os » Mon Mar 07, 2011 9:32 am

When there's no memory for your mesh, you're screwed up anyways.
0 x
Sos Sosowski :)
http://www.sos.gd

Sauce
Kobold
Posts: 26
Joined: Sat Mar 27, 2010 12:38 pm

Re: shouldContinue delegate while load scene

Post by Sauce » Mon Mar 21, 2011 4:34 am

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.
0 x

Post Reply