The Dirtchamber
A mixed reality testing environment for real-time global illumination algorithms
Public Member Functions | Static Public Member Functions | List of all members
dune::texture_cache Class Reference

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_cachei ()
 The static instance of the texture_cache.
 

Detailed Description

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.

Member Function Documentation

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.

Parameters
deviceThe Direct3D device.
filenameA string of the filename on the disk.

References dune::make_absolute_path().

Referenced by dune::load_texture().


The documentation for this class was generated from the following files: