Jagguar Game Engine
Loading...
Searching...
No Matches
ResourceManager.hpp
1#ifndef RESOURCE_MANAGER_HPP
2#define RESOURCE_MANAGER_HPP
3
4#if defined(LINUX) || defined(MINGW)
5 #include <SDL2/SDL.h>
6#else // This works for Mac
7 #include <SDL.h>
8#endif
9
10#include <unordered_map>
11#include <string>
12
18 private:
23 ResourceManager(); // Private Singleton
24 ResourceManager(ResourceManager const&); // Avoid copy constructor
25 void operator=(ResourceManager const&); // Don't allow assignment.
26
27 std::unordered_map<std::string, SDL_Surface*> surfaces;
28
29 public:
36
43 SDL_Surface* LoadResource(std::string image_filename);
44
45 // TODO SPRINT 1 (April 5): Create LoadResource overload for audio files
46
54 SDL_Surface* GetResource(std::string key);
55
59 int StartUp();
60
64 int ShutDown();
65};
66
67#endif
Definition: ResourceManager.hpp:17
ResourceManager()
Definition: ResourceManager.cpp:12
SDL_Surface * LoadResource(std::string image_filename)
Definition: ResourceManager.cpp:22
SDL_Surface * GetResource(std::string key)
Definition: ResourceManager.cpp:36
static ResourceManager & GetInstance()
Definition: ResourceManager.cpp:16
int ShutDown()
Definition: ResourceManager.cpp:40