49 return get_global_ptr()->ns_load_texture(filename, primary_file_num_channels,
50 read_mipmaps, options);
65 int primary_file_num_channels,
int alpha_file_channel,
68 primary_file_num_channels,
70 read_mipmaps, options);
86 return get_global_ptr()->ns_load_3d_texture(filename_pattern, read_mipmaps,
103 return get_global_ptr()->ns_load_2d_texture_array(filename_pattern, read_mipmaps,
120 return get_global_ptr()->ns_load_cube_map(filename_pattern, read_mipmaps,
275 make_texture(
const std::string &extension) {
282 INLINE
bool TexturePool::LookupKey::
283 operator < (
const LookupKey &other)
const {
284 if (_fullpath != other._fullpath) {
285 return _fullpath < other._fullpath;
287 if (_alpha_fullpath != other._alpha_fullpath) {
288 return _alpha_fullpath < other._alpha_fullpath;
290 if (_primary_file_num_channels != other._primary_file_num_channels) {
291 return _primary_file_num_channels < other._primary_file_num_channels;
293 if (_alpha_file_channel != other._alpha_file_channel) {
294 return _alpha_file_channel < other._alpha_file_channel;
296 return _texture_type < other._texture_type;
static void list_contents()
Lists the contents of the texture pool to cout.
static void clear_fake_texture_image()
Restores normal behavior of loading the textures actually requested.
static Texture * load_cube_map(const Filename &filename_pattern, bool read_mipmaps=false, const LoaderOptions &options=LoaderOptions())
Loads a cube map texture that is specified with a series of 6 pages, numbered 0 through 5.
static int garbage_collect()
Releases only those textures in the pool that have a reference count of exactly 1; i....
Specifies parameters that may be passed to the loader.
static void release_texture(Texture *texture)
Removes the indicated texture from the pool, indicating it will never be loaded again; the texture ma...
Represents a texture object, which is typically a single 2-d image but may also represent a 1-d or 3-...
static void rehash()
Should be called when the model-path changes, to blow away the cache of texture pathnames found along...
static bool has_fake_texture_image()
Returns true if fake_texture_image mode has been enabled, false if we are in the normal mode.
PT(Texture) TexturePool
Creates a new Texture object of the appropriate type for the indicated filename extension,...
static bool verify_texture(const Filename &filename)
Loads the given filename up into a texture, if it has not already been loaded, and returns true to in...
static Texture * get_alpha_scale_map()
Returns a standard Texture object that has been created with Texture::generate_alpha_scale_map().
The name of a file, such as a texture file or an Egg file.
static const Filename & get_fake_texture_image()
Returns the filename that was specified with a previous call to set_fake_texture_image().
static void set_fake_texture_image(const Filename &filename)
Sets a bogus filename that will be loaded in lieu of any textures requested from this point on.
static Texture * get_normalization_cube_map(int size)
Returns a standard Texture object that has been created with Texture::generate_normalization_cube_map...
static bool has_texture(const Filename &filename)
Returns true if the texture has ever been loaded, false otherwise.
Manages a list of Texture objects, as returned by TexturePool::find_all_textures().
static Texture * load_texture(const Filename &filename, int primary_file_num_channels=0, bool read_mipmaps=false, const LoaderOptions &options=LoaderOptions())
Loads the given filename up into a texture, if it has not already been loaded, and returns the new te...
static TexturePool * get_global_ptr()
Initializes and/or returns the global pointer to the one TexturePool object in the system.
static void add_texture(Texture *texture)
Adds the indicated already-loaded texture to the pool.
static TextureCollection find_all_textures(const std::string &name="*")
Returns the set of all textures found in the pool that match the indicated name (which may contain wi...
static void release_all_textures()
Releases all textures in the pool and restores the pool to the empty state.
static Texture * load_3d_texture(const Filename &filename_pattern, bool read_mipmaps=false, const LoaderOptions &options=LoaderOptions())
Loads a 3-D texture that is specified with a series of n pages, all numbered in sequence,...
static Texture * load_2d_texture_array(const Filename &filename_pattern, bool read_mipmaps=false, const LoaderOptions &options=LoaderOptions())
Loads a 2-D texture array that is specified with a series of n pages, all numbered in sequence,...
static Texture * find_texture(const std::string &name)
Returns the first texture found in the pool that matches the indicated name (which may contain wildca...