Castor3D 0.16.0
Multiplatform 3D engine
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.
 
C3D_API void clear ()
 Destroys all the shaders of the array of shaders to destroy.
 
C3D_API ShaderProgramRPtr getNewProgram (castor::String const &name, bool initialise)
 Creates a new program.
 
C3D_API ShaderProgramRPtr getAutomaticProgram (RenderNodesPass const &renderPass, PipelineFlags const &flags)
 Looks for an automatically generated program corresponding to given flags.
 
void lock () const
 Locks the collection mutex.
 
void unlock () const
 Unlocks the collection mutex.
 
ShaderProgramPtrArray::iterator begin ()
 Retrieves an iterator to the beginning of the shaders list.
 
ShaderProgramPtrArray::const_iterator begin () const
 Retrieves an iterator to the beginning of the shaders list.
 
ShaderProgramPtrArray::iterator end ()
 Retrieves an iterator to the end of the shaders list.
 
ShaderProgramPtrArray::const_iterator end () const
 Retrieves an iterator to the end of the shaders list.
 
- Public Member Functions inherited from castor::OwnedBy< Engine >
Engine * getOwner () const
 

Additional Inherited Members

- Protected Member Functions inherited from castor::OwnedBy< Engine >
 OwnedBy (Engine &owner)
 Constructor.
 

Constructor & Destructor Documentation

◆ ShaderProgramCache()

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

Constructor.

Parameters
[in]engineThe engine

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 ShaderProgramRPtr 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 ShaderProgramRPtr 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: