how can I change the class so it is more like a resource manager, and won't invalidate any pointers after a resize (would this be achieved by using something like a deque, or does it call for much bigger changes)
Yes, that's why eXpl0it3r and I keep recommending another container. But if you remove resources from the middle,
std::deque won't help you further. The main advantage it has over
std::vector is that it doesn't relocate its elements while growing.
If you're looking for a resource manager, you could use the one from Thor as suggested by Hiura. It's relatively easy to use (see
tutorial and
API documentation).
namespace res = thor::Resources;
// Load resources
thor::ResourceHolder<sf::Texture, std::string> textures;
textures.acquire("monster", res::fromFile<sf::Texture>("monster.png"));
// Use resources
sf::Sprite sprite;
sprite.setTexture(textures["monster"]);
An advantage is that
thor::ResourceHolder is generic: you can use it with textures, fonts, sound buffers, or even your own resource classes. It handles errors with exceptions, so you don't have to check every loading call. And it provides a few more sophisticated features in case you need them