Class · aurore

aurore::TextureCache

On this page
aurore/core/cache_helper.hpp
#include <aurore/core/cache_helper.hpp>

class aurore::TextureCache : public aurore::Singleton< TextureCache >

Constructors 1

TextureCache()

Functions 11

int getCache(const std::string &key)
void addCache(const std::string &key, size_t texture)
void removeCache(size_t texture)

Subtract the matching texture cache counter by 1, and delete the cache if the counter returns to zero.

cache_helper.hpp:363
void markDirty(size_t texture)
void updateCache(size_t old_tex, size_t new_tex)

update texture id

cache_helper.hpp:380
void setMemoryBudget(size_t bytes)

At most bytes of textures nothing shows are kept (0: no limit, the default); the least recently used go first. A texture weighs its width × height × 4.

cache_helper.hpp:392
size_t getTotalBytes() const
size_t getSize() const
void clean()
void trimUnused()

Free GPU memory for all textures whose reference count has reached zero. Safe to call at any time; in-use textures (count > 0) are left untouched.

cache_helper.hpp:417
void debug()

Also the functions of aurore::Singleton (1).

Attributes 1

LRUCache< std::string, size_t > cache = LRUCache<std::string, size_t>(200, 0)

Read from Aurore's headers by Doxygen at each build · library/include