#pragma once #include #include #include #include #include class TextureManager { public: TextureManager() {} ~TextureManager() { for (auto& it : this->texture_cache) { SDL_DestroyTexture(it.second); } } std::map texture_cache; SDL_Texture* loadTexture(const char* fileName); static std::vector splitSpriteSheet(SDL_Texture* spriteSheet, int width, int height, int spritesOnSheet); static void draw(SDL_Texture* texture, SDL_Rect src, SDL_Rect dest, bool flipped = false); };