ShaderPool¶
-
class ShaderPool¶
This is the preferred interface for loading shaders for the
TextNodesystem. It is similar toModelPoolandTexturePoolin that it unifies references to the same filename.Inheritance diagram
digraph inheritance58dc0a91dd { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "ShaderPool" [URL="acron.core.ShaderPool.html#acron.core.ShaderPool",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "ShaderPool" [arrowsize=0.75,style=""]; }- static ShaderPool.add_shader()¶
Adds the indicated already-loaded shader to the pool. The shader will always replace any previously-loaded shader in the pool that had the same filename.
- static ShaderPool.garbage_collect()¶
Releases only those shaders in the pool that have a reference count of exactly 1; i.e. only those shaders that are not being used outside of the pool. Returns the number of shaders released.
- static ShaderPool.has_shader()¶
Returns true if the shader has ever been loaded, false otherwise.
- static ShaderPool.list_contents()¶
Lists the contents of the shader pool to the indicated output stream.
- static ShaderPool.load_shader()¶
Loads the given filename up into a shader, if it has not already been loaded, and returns the new shader. If a shader with the same filename was previously loaded, returns that one instead. If the shader file cannot be found, returns NULL.
- static ShaderPool.release_all_shaders()¶
Releases all shaders in the pool and restores the pool to the empty state.
- static ShaderPool.release_shader()¶
Removes the indicated shader from the pool, indicating it will never be loaded again; the shader may then be freed. If this function is never called, a reference count will be maintained on every shader every loaded, and shaders will never be freed.
- static ShaderPool.verify_shader()¶
Loads the given filename up into a shader, if it has not already been loaded, and returns true to indicate success, or false to indicate failure. If this returns true, it is guaranteed that a subsequent call to
load_shader()with the same shader name will return a valid Shader pointer.
- static ShaderPool.write()¶
Lists the contents of the shader pool to the indicated output stream.