36 #include <OgreCompositorInstance.h> 50 Shader(Ogre::SceneManager* scenemanager =
nullptr);
56 if (this->bVisible_ != bVisible)
58 this->bVisible_ = bVisible;
59 this->updateVisibility();
64 {
return this->bVisible_; }
65 void updateVisibility();
70 if (this->compositorName_ != name)
72 this->compositorName_ = name;
73 this->changedCompositorName();
78 {
return this->compositorName_; }
79 void changedCompositorName();
80 void changedCompositorName(Ogre::Viewport* viewport);
84 { this->scenemanager_ = scenemanager; }
87 {
return this->scenemanager_; }
89 virtual void cameraChanged(Ogre::Viewport* viewport, Ogre::Camera* oldCamera)
override;
91 void setParameter(
unsigned short technique,
unsigned short pass,
const std::string& parameter,
float value);
92 void setParameter(
unsigned short technique,
unsigned short pass,
const std::string& parameter,
int value);
94 virtual void notifyMaterialRender(Ogre::uint32 pass_id, Ogre::MaterialPtr& materialPtr)
override;
97 static bool hasCgProgramManager();
107 void addAsListener();
bool registeredAsListener_
True if the shader should register itself as listener at the compositor.
Definition: Shader.h:120
unsigned short pass_
The ID of the pass.
Definition: Shader.h:113
bool bVisible_
True if the shader should be visible.
Definition: Shader.h:101
::std::string string
Definition: gtest-port.h:756
Ogre::SceneManager * getSceneManager() const
Returns the scene manager.
Definition: Shader.h:86
unsigned short technique_
The ID of the technique.
Definition: Shader.h:112
std::string compositorName_
The name of the current compositor.
Definition: Shader.h:103
Definition: ViewportEventListener.h:39
void setCompositorName(const std::string &name)
Defines the compositor's name (located in a .compositor file).
Definition: Shader.h:68
Shader is a wrapper class around Ogre::CompositorInstance.
Definition: Shader.h:47
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
Declaration of the MultiType and some helper constructs.
const std::string & getCompositorName() const
Returns the compositor's name.
Definition: Shader.h:77
The MultiType can hold a value of many possible types and convert them to other types.
Definition: MultiType.h:130
bool isVisible() const
Returns whether or not the shader is visible.
Definition: Shader.h:63
std::string parameter_
The name of the parameter.
Definition: Shader.h:114
Ogre::SceneManager * scenemanager_
The scenemanager for which the shader is active.
Definition: Shader.h:99
Ogre::CompositorInstance * compositorInstance_
The compositor instance representing the wrapped compositor.
Definition: Shader.h:100
std::string oldcompositorName_
The name of the previous compositor (used to unregister)
Definition: Shader.h:104
void setSceneManager(Ogre::SceneManager *scenemanager)
Sets the scenemanager (usually provided in the constructor, but can be set later). Shouldn't be changed once it's set.
Definition: Shader.h:83
std::list< ParameterContainer > parameters_
The list of parameters that should be set on the next update.
Definition: Shader.h:119
Helper struct to store parameters for shader programs.
Definition: Shader.h:110
MultiType value_
The desired value of the parameter.
Definition: Shader.h:116
bool bLoadCompositor_
True if the compositor should be loaded (usually false if no graphics)
Definition: Shader.h:102
void setVisible(bool bVisible)
Defines if the shader is visible or not.
Definition: Shader.h:54