62 return _cache_models && _active;
72 _cache_textures = flag;
84 return _cache_textures && _active;
103 _cache_compressed_textures = flag;
115 return _cache_compressed_textures && _active;
126 _cache_compiled_shaders = flag;
138 return _cache_compiled_shaders && _active;
156 _flush_time = flush_time;
181 _max_kbytes = max_kbytes;
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);
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.
get_active
Returns true if the BamCache is currently active, false if it is not.
get_cache_models
Returns 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.
void consider_flush_index()
Flushes the index if enough time has elapsed since the index was last flushed.
static void flush_global_index()
If there is a global BamCache object, calls flush_index() on it.
get_cache_textures
Returns whether texture files (e.g.
get_root
Returns the current root pathname of the cache.
set_flush_time
Specifies the time in seconds between automatic flushes of the cache index.
get_cache_max_kbytes
Returns the maximum size, in kilobytes, which the cache is allowed to grow to.
static BamCache * get_global_ptr()
Returns a pointer to the global BamCache object, which is used automatically by the ModelPool and Tex...
void flush_index()
Ensures the index is written to disk.
set_active
Changes the state of the active flag.
set_cache_compiled_shaders
Indicates whether compiled shader programs will be stored in the cache, as binary ....
get_flush_time
Returns the time in seconds between automatic flushes of the cache index.
get_cache_compressed_textures
Returns whether compressed texture files will be stored in the cache, as compressed txo files.
set_cache_max_kbytes
Specifies the maximum size, in kilobytes, which the cache is allowed to grow to.
set_cache_models
Indicates whether model files (e.g.
set_cache_textures
Indicates whether texture files will be stored in the cache, as uncompressed txo files.
get_cache_compiled_shaders
Returns whether compiled shader programs will be stored in the cache, as binary .txo files.
set_cache_compressed_textures
Indicates whether compressed texture files will be stored in the cache, as compressed txo files.
get_read_only
Returns true if the cache is in read-only mode.
The name of a file, such as a texture file or an Egg file.
Similar to MutexHolder, but for a reentrant mutex.