19 return get_ptr()->ns_has_shader(filename);
30 return load_shader(filename) !=
nullptr;
40 load_shader(
const Filename &filename) {
41 return get_ptr()->ns_load_shader(filename);
51 get_ptr()->ns_add_shader(filename, shader);
62 get_ptr()->ns_release_shader(filename);
70 get_ptr()->ns_release_all_shaders();
80 return get_ptr()->ns_garbage_collect();
88 get_ptr()->ns_list_contents(out);
static void add_shader(const Filename &filename, Shader *shader)
Adds the indicated already-loaded shader to the pool.
static void release_all_shaders()
Releases all shaders in the pool and restores the pool to the empty state.
static int garbage_collect()
Releases only those shaders in the pool that have a reference count of exactly 1; i....
CPT(Shader) ShaderPool
Loads the given filename up into a shader, if it has not already been loaded, and returns the new sha...
The name of a file, such as a texture file or an Egg file.
static bool verify_shader(const Filename &filename)
Loads the given filename up into a shader, if it has not already been loaded, and returns true to ind...
static void release_shader(const Filename &filename)
Removes the indicated shader from the pool, indicating it will never be loaded again; the shader may ...
static void list_contents(std::ostream &out)
Lists the contents of the shader pool to the indicated output stream.
static bool has_shader(const Filename &filename)
Returns true if the shader has ever been loaded, false otherwise.