#include <shadergroup.h>
Public Member Functions | |
| ShaderGroup (const std::string &groupName) | |
| Constructs an empty shader group. | |
| const std::string & | GetName () const |
| Gets the name currently assigned to this group. | |
| void | AddShader (ShaderProgram &shader, bool isDefault=false) |
| Adds a shader to the group's list of shaders. | |
| void | RemoveShader (ShaderProgram &shader) |
| Removes the specified shader from this shader group. | |
| void | RemoveShader (const std::string &shaderName) |
| Removes the shader with the specified name from this shader group. | |
| void | RemoveAllShaders () |
| Clears the group's list of shaders. | |
| ShaderProgram * | FindShader (const std::string &name) |
| Searches the group for a shader with the specified name. | |
| const ShaderProgram * | FindShader (const std::string &name) const |
| Searches the group for a shader with the specified name. | |
| unsigned int | GetNumShaders () const |
| Gets the number of shaders currently owned by this shader group. | |
| void | GetAllShaders (std::vector< dtCore::RefPtr< ShaderProgram > > &toFill) |
| Gets a list of all the shaders owned by this shader group. | |
| const ShaderProgram * | GetDefaultShader () const |
| Gets the default shader assigned to this group. | |
| ShaderProgram * | GetDefaultShader () |
| Non const verstion of GetDefaultShader(). | |
| virtual void | Update () |
| Updates this shader group's state by calling update on each shader it is currently maintaining. | |
| void | SetDirty (bool flag) |
| Sets the dirty flag of this shader group. | |
| bool | IsDirty () const |
| Gets the dirty bit of this shader group. | |
Protected Member Functions | |
| virtual | ~ShaderGroup () |
| Destroys the shader group. | |
It allows shaders to be logically grouped together providing a simple way to assign shaders to actors. If a shader group contains more than a default shader (all defined in the Shader Definitions XML file) then it is the actor's responsibility to find the appropriate shader from the group and ask the shader manager to apply it.
| dtCore::ShaderGroup::ShaderGroup | ( | const std::string & | groupName | ) |
Constructs an empty shader group.
| groupName | Name of this group. Group names must be unique. |
| dtCore::ShaderGroup::~ShaderGroup | ( | ) | [protected, virtual] |
Destroys the shader group.
| const std::string& dtCore::ShaderGroup::GetName | ( | ) | const [inline] |
Gets the name currently assigned to this group.
| void dtCore::ShaderGroup::AddShader | ( | ShaderProgram & | shader, | |
| bool | isDefault = false | |||
| ) |
Adds a shader to the group's list of shaders.
| shader | The new shader to add to the group. Note, if a shader with the same name already exists in the group, an exception is thrown. | |
| isDefault | If true, this shader is set as the default shader. |
| void dtCore::ShaderGroup::RemoveShader | ( | ShaderProgram & | shader | ) |
Removes the specified shader from this shader group.
| shader | The shader to remove. |
| void dtCore::ShaderGroup::RemoveShader | ( | const std::string & | shaderName | ) |
Removes the shader with the specified name from this shader group.
| shaderName | The name of the shader to remove. If a shader is not found with that name a warning is logged and this method becomes a no-op. |
| void dtCore::ShaderGroup::RemoveAllShaders | ( | ) | [inline] |
Clears the group's list of shaders.
| ShaderProgram * dtCore::ShaderGroup::FindShader | ( | const std::string & | name | ) |
Searches the group for a shader with the specified name.
| const ShaderProgram * dtCore::ShaderGroup::FindShader | ( | const std::string & | name | ) | const |
Searches the group for a shader with the specified name.
(const-version).
| unsigned int dtCore::ShaderGroup::GetNumShaders | ( | ) | const [inline] |
Gets the number of shaders currently owned by this shader group.
| void dtCore::ShaderGroup::GetAllShaders | ( | std::vector< dtCore::RefPtr< ShaderProgram > > & | toFill | ) |
Gets a list of all the shaders owned by this shader group.
| toFill | A list to be filled with the shaders in this group. |
| const ShaderProgram* dtCore::ShaderGroup::GetDefaultShader | ( | ) | const [inline] |
Gets the default shader assigned to this group.
| ShaderProgram* dtCore::ShaderGroup::GetDefaultShader | ( | ) | [inline] |
Non const verstion of GetDefaultShader().
| void dtCore::ShaderGroup::Update | ( | ) | [virtual] |
Updates this shader group's state by calling update on each shader it is currently maintaining.
| void dtCore::ShaderGroup::SetDirty | ( | bool | flag | ) | [inline] |
Sets the dirty flag of this shader group.
| flag | True if dirty, false otherwise. |
| bool dtCore::ShaderGroup::IsDirty | ( | ) | const [inline] |
Gets the dirty bit of this shader group.