1 #ifndef IMAGE_MANAGER_HPP
2 #define IMAGE_MANAGER_HPP
39 int imgFlags = IMG_INIT_PNG;
40 if (!(IMG_Init(imgFlags) & imgFlags))
42 SDL_LogError(SDL_LOG_CATEGORY_RENDER,
"Couldn't start image manager");
46 fileMap.emplace(
"background",
"./Assets/images/background.png");
55 std::shared_ptr<TextureWrapper>
Load(
const std::string &path)
57 SDL_Texture* img = IMG_LoadTexture(ren, path.c_str());
61 printf(
"%s\n", IMG_GetError());
66 SDL_Log(
"Allocated image memory for %s", path.c_str());
67 std::shared_ptr<SDL_Texture> surface = std::shared_ptr<SDL_Texture>(img, SDL_DestroyTexture);
68 return std::make_shared<TextureWrapper>(surface);
77 printf(
"Constructing image manager\n");
void operator=(ImageManager const &) = delete
don't allow assignment
std::shared_ptr< TextureWrapper > Load(const std::string &path)
Definition: ImageManager.hpp:55
std::map< std::string, std::string > fileMap
stores location of resources
Definition: ResourceManager.hpp:156
int startUp(SDL_Renderer *in)
Definition: ImageManager.hpp:37
int shutDown()
Definition: ResourceManager.hpp:69
int shutDown()
Definition: ImageManager.hpp:25
static ImageManager & instance()
Definition: ImageManager.hpp:16
Definition: ResourceManager.hpp:62
Definition: ImageManager.hpp:10