1 #ifndef SPRITE_MANAGER_HPP
2 #define SPRITE_MANAGER_HPP
30 fileMap.emplace(
"sprite",
"./Assets/sprites/sprite.bmp");
39 std::shared_ptr<Sprite>
Load(
const std::string &path)
42 std::shared_ptr<SDL_Surface> surface = std::shared_ptr<SDL_Surface>(SDL_LoadBMP(path.data()), SDL_FreeSurface);
46 SDL_Log(
"Failed to allocate surface");
51 SDL_Log(
"Allocated a bunch of memory to create identical game character");
54 std::shared_ptr<Sprite> s = std::make_shared<Sprite>();
55 s->spriteSheet = surface;
56 s->texture = std::shared_ptr<SDL_Texture>(SDL_CreateTextureFromSurface(ren, surface.get()), SDL_DestroyTexture);
std::shared_ptr< Sprite > Load(const std::string &path)
Definition: SpriteManager.hpp:39
std::map< std::string, std::string > fileMap
stores location of resources
Definition: ResourceManager.hpp:156
int startUp(SDL_Renderer *in)
Definition: SpriteManager.hpp:27
static SpriteManager & instance()
Definition: SpriteManager.hpp:16
Definition: ResourceManager.hpp:62
Definition: SpriteManager.hpp:10