37 INLINE
bool BamCache::
59 INLINE
bool BamCache::
60 get_cache_models()
const {
62 return _cache_models && _active;
72 _cache_textures = flag;
81 INLINE
bool BamCache::
82 get_cache_textures()
const {
84 return _cache_textures && _active;
103 _cache_compressed_textures = flag;
112 INLINE
bool BamCache::
113 get_cache_compressed_textures()
const {
115 return _cache_compressed_textures && _active;
126 _cache_compiled_shaders = flag;
135 INLINE
bool BamCache::
136 get_cache_compiled_shaders()
const {
138 return _cache_compiled_shaders && _active;
156 _flush_time = flush_time;
162 INLINE
int BamCache::
163 get_flush_time()
const {
181 _max_kbytes = max_kbytes;
189 INLINE
int BamCache::
190 get_cache_max_kbytes()
const {
212 INLINE
bool BamCache::
213 get_read_only()
const {
224 if (_global_ptr ==
nullptr) {
235 if (_global_ptr !=
nullptr) {
245 if (_global_ptr !=
nullptr) {
254 INLINE
void BamCache::
256 if (_index_stale_since == 0) {
257 _index_stale_since = time(
nullptr);
static void flush_global_index()
If there is a global BamCache object, calls flush_index() on it.
set_active
Changes the state of the active flag.
set_cache_max_kbytes
Specifies the maximum size, in kilobytes, which the cache is allowed to grow to.
This class maintains a cache of Bam and/or Txo objects generated from model files and texture images ...
static void consider_flush_global_index()
If there is a global BamCache object, calls consider_flush_index() on it.
set_cache_compressed_textures
Indicates whether compressed texture files will be stored in the cache, as compressed txo files.
void flush_index()
Ensures the index is written to disk.
set_cache_models
Indicates whether model files (e.g.
set_read_only
Can be used to put the cache in read-only mode, or take it out of read-only mode.
The name of a file, such as a texture file or an Egg file.
set_cache_textures
Indicates whether texture files will be stored in the cache, as uncompressed txo files.
Similar to MutexHolder, but for a reentrant mutex.
set_flush_time
Specifies the time in seconds between automatic flushes of the cache index.
set_cache_compiled_shaders
Indicates whether compiled shader programs will be stored in the cache, as binary ....
static BamCache * get_global_ptr()
Returns a pointer to the global BamCache object, which is used automatically by the ModelPool and Tex...
void consider_flush_index()
Flushes the index if enough time has elapsed since the index was last flushed.