Resource Managers - Are they any good?

Posted by The Communist Duck on Game Development See other posts from Game Development or by The Communist Duck
Published on 2010-08-04T19:21:44Z Indexed on 2011/11/17 2:06 UTC
Read the original article Hit count: 167

Filed under:
|

Hey.
I've seen many a time in source code, things like this [well, this is more of a pseudo C++ idea of mine]
type defshared_ptr ResourcePtr;// for ease
ResourcePtr sound1 = resourceManager.Get("boom.ogg");
sound1->Play();
ResourcePtr sprite = resourceManager.Get("sprite.png");

I was just wondering how useful a class like this was, something that:

  • Loaded media files
  • Stored them in memory
  • Did this at the start of a level - loading screen.
  • Cleaned up

Rather than having a system of:

  • Resources are held by entities only, or loose.
  • Responsible for own load into memory.

The first is a 'manager' as such; something I feel indicates it's wrong to use. However, it allows for something like a vector of resource names to be passed, rather than having to scramble around finding everything that needs to be loaded.

© Game Development or respective owner

Related posts about architecture

Related posts about resources