28class EXPCL_PANDA_PGRAPH ShaderPool {
32 BLOCKING INLINE
static CPT(
Shader) load_shader(
const Filename &filename);
40 static void write(std::ostream &out);
45 bool ns_has_shader(
const Filename &orig_filename);
48 void ns_release_shader(
const Filename &orig_filename);
49 void ns_release_all_shaders();
50 int ns_garbage_collect();
51 void ns_list_contents(std::ostream &out)
const;
53 void resolve_filename(
Filename &new_filename,
const Filename &orig_filename);
55 static ShaderPool *get_ptr();
56 static ShaderPool *_global_ptr;
The name of a file, such as a texture file or an Egg file.
This is a standard, non-reentrant mutex, similar to the Mutex class.
static void list_contents(std::ostream &out)
Lists the contents of the shader pool to the indicated output stream.
static void write(std::ostream &out)
Lists the contents of the shader pool to the indicated output stream.
static void add_shader(const Filename &filename, Shader *shader)
Adds the indicated already-loaded shader to the pool.
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 int garbage_collect()
Releases only those shaders in the pool that have a reference count of exactly 1; i....
static void release_all_shaders()
Releases all shaders in the pool and restores the pool to the empty state.
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 bool has_shader(const Filename &filename)
Returns true if the shader has ever been loaded, false otherwise.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.