The Dirtchamber
A mixed reality testing environment for real-time global illumination algorithms
|
A texture cache. More...
#include <texture_cache.h>
Inherits noncopyable.
Public Member Functions | |
void | add_texture (ID3D11Device *device, const tstring &filename) |
Add a new texture to the cache. More... | |
void | destroy () |
Destroy the texture_cache and free all resources. | |
Static Public Member Functions | |
static texture_cache & | i () |
The static instance of the texture_cache. | |
A texture cache.
The texture_cache is a single instance which keeps track of all currently loaded texture resources. By requesting texture objects from this class, multiple requests of the same file will be cached instead of creating additional textures in memory.
void dune::texture_cache::add_texture | ( | ID3D11Device * | device, |
const tstring & | filename | ||
) |
Add a new texture to the cache.
Load a new texture and add it to the cache. If the texture has already been loaded, nothing happens.
device | The Direct3D device. |
filename | A string of the filename on the disk. |
References dune::make_absolute_path().
Referenced by dune::load_texture().