Textures

Defines

TNT_TEXTURES_ASSETS_CACHE_INL
namespace tnt

Typedefs

template<unsigned I>
using texture_cache = asset_cache<SDL_Texture, I>
using small_texture_cache = texture_cache<10>
using medium_texture_cache = texture_cache<50>
using large_texture_cache = texture_cache<100>
template<unsigned I>
class asset_cache<SDL_Texture, I>

Public Functions

~asset_cache() noexcept
SDL_Texture *get(SDL_Renderer *ren, std::string_view path)
void load(SDL_Renderer *ren, std::string_view path)
void remove(std::string_view path)

Private Members

std::byte memory[I * sizeof(SDL_Texture*)]
std::pmr::monotonic_buffer_resource res = {memory, sizeof(memory)}
std::pmr::unordered_map<std::string, SDL_Texture*> cache = {&res}