Castor3D  ..
Public Member Functions | List of all members
Castor3D::ShaderManager Class Reference

Manager used to hold the shader programs. Holds it, destroys it during a rendering loop. More...

+ Inheritance diagram for Castor3D::ShaderManager:
+ Collaboration diagram for Castor3D::ShaderManager:

Public Member Functions

C3D_API ShaderManager (Engine &p_engine)
 Constructor. More...
 
C3D_API ~ShaderManager ()
 Destructor. More...
 
C3D_API void Clear ()
 Destroys all the shaders of the array of shaders to destroy. More...
 
C3D_API void Cleanup ()
 Cleans up all the shaders. More...
 
C3D_API ShaderProgramSPtr GetNewProgram (eSHADER_LANGUAGE p_langage=eSHADER_LANGUAGE_AUTO)
 Creates a new program. More...
 
C3D_API ShaderProgramSPtr GetAutomaticProgram (RenderTechnique const &p_technique, uint32_t p_textureFlags, uint32_t p_programFlags)
 Looks for an automatically generated program corresponding to given flags. More...
 
C3D_API ShaderProgramSPtr GetBillboardProgram (uint32_t p_textureFlags, uint32_t p_programFlags) const
 Looks for a billboards shader program corresponding to given flags. More...
 
C3D_API void AddBillboardProgram (ShaderProgramSPtr p_program, uint32_t p_textureFlags, uint32_t p_programFlags)
 Adds a billboards shader program corresponding to given flags. More...
 
C3D_API FrameVariableBufferSPtr CreateMatrixBuffer (ShaderProgram &p_program, uint32_t p_shaderMask)
 Creates a matrix frame variable buffer. More...
 
C3D_API FrameVariableBufferSPtr CreateSceneBuffer (ShaderProgram &p_program, uint32_t p_shaderMask)
 Creates a scene frame variable buffer. More...
 
C3D_API FrameVariableBufferSPtr CreatePassBuffer (ShaderProgram &p_program, uint32_t p_shaderMask)
 Creates a pass frame variable buffer. More...
 
C3D_API void CreateTextureVariables (ShaderProgram &p_program, uint32_t p_uiTextureFlags)
 Creates the textures related frame variables. More...
 
void lock () const
 Locks the collection mutex. More...
 
void unlock () const
 Unlocks the collection mutex. More...
 
void SetRenderSystem (RenderSystem *const &p_renderSystem)
 Sets the RenderSystem. 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...
 

Detailed Description

Manager used to hold the shader programs. Holds it, destroys it during a rendering loop.

Author
Sylvain DOREMUS
Date
14/02/2010

Constructor & Destructor Documentation

◆ ShaderManager()

C3D_API Castor3D::ShaderManager::ShaderManager ( Engine p_engine)

Constructor.

Parameters
[in]p_engineThe engine

◆ ~ShaderManager()

C3D_API Castor3D::ShaderManager::~ShaderManager ( )

Destructor.

Member Function Documentation

◆ AddBillboardProgram()

C3D_API void Castor3D::ShaderManager::AddBillboardProgram ( ShaderProgramSPtr  p_program,
uint32_t  p_textureFlags,
uint32_t  p_programFlags 
)

Adds a billboards shader program corresponding to given flags.

Parameters
[in]p_programThe program to add.
[in]p_textureFlagsBitwise ORed eTEXTURE_CHANNEL.
[in]p_programFlagsBitwise ORed ePROGRAM_FLAG.
Returns
The found program.

◆ begin() [1/2]

ShaderProgramPtrArray::iterator Castor3D::ShaderManager::begin ( )
inline

Retrieves an iterator to the beginning of the shaders list.

Returns
The iterator

◆ begin() [2/2]

ShaderProgramPtrArray::const_iterator Castor3D::ShaderManager::begin ( ) const
inline

Retrieves an iterator to the beginning of the shaders list.

Returns
The iterator

◆ Cleanup()

C3D_API void Castor3D::ShaderManager::Cleanup ( )

Cleans up all the shaders.

◆ Clear()

C3D_API void Castor3D::ShaderManager::Clear ( )

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

◆ CreateMatrixBuffer()

C3D_API FrameVariableBufferSPtr Castor3D::ShaderManager::CreateMatrixBuffer ( ShaderProgram p_program,
uint32_t  p_shaderMask 
)

Creates a matrix frame variable buffer.

Parameters
[in]p_programThe programme to which the buffer is bound
[in]p_shaderMaskMASK_SHADER_TYPE combination, to set at what shaders it is to be bound
Returns
The frame variable buffer

◆ CreatePassBuffer()

C3D_API FrameVariableBufferSPtr Castor3D::ShaderManager::CreatePassBuffer ( ShaderProgram p_program,
uint32_t  p_shaderMask 
)

Creates a pass frame variable buffer.

Parameters
[in]p_programThe program to which the buffer is bound
[in]p_shaderMaskMASK_SHADER_TYPE combination, to set at what shaders it is to be bound
Returns
The frame variable buffer

◆ CreateSceneBuffer()

C3D_API FrameVariableBufferSPtr Castor3D::ShaderManager::CreateSceneBuffer ( ShaderProgram p_program,
uint32_t  p_shaderMask 
)

Creates a scene frame variable buffer.

Parameters
[in]p_programThe program to which the buffer is bound
[in]p_shaderMaskMASK_SHADER_TYPE combination, to set at what shaders it is to be bound
Returns
The frame variable buffer

◆ CreateTextureVariables()

C3D_API void Castor3D::ShaderManager::CreateTextureVariables ( ShaderProgram p_program,
uint32_t  p_uiTextureFlags 
)

Creates the textures related frame variables.

Parameters
[in]p_uiTextureFlagsBitwise ORed eTEXTURE_CHANNEL
[in]p_programThe program to which the buffer is bound

◆ end() [1/2]

ShaderProgramPtrArray::iterator Castor3D::ShaderManager::end ( )
inline

Retrieves an iterator to the end of the shaders list.

Returns
The iterator

◆ end() [2/2]

ShaderProgramPtrArray::const_iterator Castor3D::ShaderManager::end ( ) const
inline

Retrieves an iterator to the end of the shaders list.

Returns
The iterator

◆ GetAutomaticProgram()

C3D_API ShaderProgramSPtr Castor3D::ShaderManager::GetAutomaticProgram ( RenderTechnique const &  p_technique,
uint32_t  p_textureFlags,
uint32_t  p_programFlags 
)

Looks for an automatically generated program corresponding to given flags.

Remarks
If none exists it is created
Parameters
[in]p_techniqueThe technique from witch the program code is retrieved
[in]p_textureFlagsBitwise ORed eTEXTURE_CHANNEL
[in]p_programFlagsBitwise ORed ePROGRAM_FLAG
Returns
The found or created program

◆ GetBillboardProgram()

C3D_API ShaderProgramSPtr Castor3D::ShaderManager::GetBillboardProgram ( uint32_t  p_textureFlags,
uint32_t  p_programFlags 
) const

Looks for a billboards shader program corresponding to given flags.

Parameters
[in]p_textureFlagsBitwise ORed eTEXTURE_CHANNEL.
[in]p_programFlagsBitwise ORed ePROGRAM_FLAG.
Returns
The found program.

◆ GetNewProgram()

C3D_API ShaderProgramSPtr Castor3D::ShaderManager::GetNewProgram ( eSHADER_LANGUAGE  p_langage = eSHADER_LANGUAGE_AUTO)

Creates a new program.

Parameters
[in]p_langageThe wanted shader language
Returns
The newly created program

◆ lock()

void Castor3D::ShaderManager::lock ( ) const
inline

Locks the collection mutex.

◆ SetRenderSystem()

void Castor3D::ShaderManager::SetRenderSystem ( RenderSystem *const &  p_renderSystem)
inline

Sets the RenderSystem.

Parameters
[in]p_renderSystemThe new value

◆ unlock()

void Castor3D::ShaderManager::unlock ( ) const
inline

Unlocks the collection mutex.


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