Castor3D 0.12.0
Multiplatform 3D engine
Classes | Public Member Functions | List of all members
castor3d::ShaderProgramCache Class Reference

#include <ShaderCache.hpp>

Inheritance diagram for castor3d::ShaderProgramCache:
Inheritance graph
[legend]
Collaboration diagram for castor3d::ShaderProgramCache:
Collaboration graph
[legend]

Public Member Functions

C3D_API ShaderProgramCache (Engine &engine)
 Constructor. More...
 
C3D_API ~ShaderProgramCache ()
 Destructor. More...
 
C3D_API void clear ()
 Destroys all the shaders of the array of shaders to destroy. More...
 
C3D_API ShaderProgramSPtr getNewProgram (castor::String const &name, bool initialise)
 Creates a new program. More...
 
C3D_API ShaderProgramSPtr getAutomaticProgram (RenderNodesPass const &renderPass, PipelineFlags const &flags)
 Looks for an automatically generated program corresponding to given flags. More...
 
void lock () const
 Locks the collection mutex. More...
 
void unlock () const
 Unlocks the collection mutex. More...
 
ShaderProgramPtrArray::iterator begin ()
 Retrieves an iterator to the beginning of the shaders list. More...
 
ShaderProgramPtrArray::const_iterator begin () const
 Retrieves an iterator to the beginning of the shaders list. More...
 
ShaderProgramPtrArray::iterator end ()
 Retrieves an iterator to the end of the shaders list. More...
 
ShaderProgramPtrArray::const_iterator end () const
 Retrieves an iterator to the end of the shaders list. More...
 

Constructor & Destructor Documentation

◆ ShaderProgramCache()

C3D_API castor3d::ShaderProgramCache::ShaderProgramCache ( Engine engine)
explicit

Constructor.

Parameters
[in]engineThe engine

◆ ~ShaderProgramCache()

C3D_API castor3d::ShaderProgramCache::~ShaderProgramCache ( )

Destructor.

Member Function Documentation

◆ begin() [1/2]

ShaderProgramPtrArray::iterator castor3d::ShaderProgramCache::begin ( )
inline

Retrieves an iterator to the beginning of the shaders list.

Returns
The iterator

◆ begin() [2/2]

ShaderProgramPtrArray::const_iterator castor3d::ShaderProgramCache::begin ( ) const
inline

Retrieves an iterator to the beginning of the shaders list.

Returns
The iterator

◆ clear()

C3D_API void castor3d::ShaderProgramCache::clear ( )

Destroys all the shaders of the array of shaders to destroy.

◆ end() [1/2]

ShaderProgramPtrArray::iterator castor3d::ShaderProgramCache::end ( )
inline

Retrieves an iterator to the end of the shaders list.

Returns
The iterator

◆ end() [2/2]

ShaderProgramPtrArray::const_iterator castor3d::ShaderProgramCache::end ( ) const
inline

Retrieves an iterator to the end of the shaders list.

Returns
The iterator

◆ getAutomaticProgram()

C3D_API ShaderProgramSPtr castor3d::ShaderProgramCache::getAutomaticProgram ( RenderNodesPass const &  renderPass,
PipelineFlags const &  flags 
)

Looks for an automatically generated program corresponding to given flags.

Remarks
If none exists it is created.
Parameters
[in]renderPassThe pass from which the program code is retrieved.
[in]flagsThe pipeline flags.
Returns
The found or created program.

◆ getNewProgram()

C3D_API ShaderProgramSPtr castor3d::ShaderProgramCache::getNewProgram ( castor::String const &  name,
bool  initialise 
)

Creates a new program.

Parameters
[in]nameThe program name.
[in]initialiseTells if we want the program to be initialised.
Returns
The newly created program.

◆ lock()

void castor3d::ShaderProgramCache::lock ( ) const
inline

Locks the collection mutex.

◆ unlock()

void castor3d::ShaderProgramCache::unlock ( ) const
inline

Unlocks the collection mutex.


The documentation for this class was generated from the following file: