15 SDL_Texture* getTexture(SDL_Renderer* renderer,
const std::string& path);
19 struct TextureDeleter {
20 void operator()(SDL_Texture* texture)
const {
21 SDL_DestroyTexture(texture);
26 SDL_Renderer* renderer;
27 std::unique_ptr<SDL_Texture, TextureDeleter> texture;
28 CacheEntry(SDL_Renderer* r, SDL_Texture* t) : renderer(r), texture(t) {}
31 std::unordered_map<std::string, CacheEntry> cache_;
32 std::list<std::string> lruKeys_;
33 static const size_t MAX_CACHE_SIZE = 100;
Definition texture_cache.h:10