#include <src/orxonox/tools/Shader.h>
Public Member Functions | |
void | changedCompositor () |
const std::string & | getCompositor () const |
Ogre::SceneManager * | getSceneManager () const |
bool | isVisible () const |
void | setCompositor (const std::string &compositor) |
void | setParameter (const std::string &material, size_t technique, size_t pass, const std::string ¶meter, int value) |
void | setParameter (const std::string &material, size_t technique, size_t pass, const std::string ¶meter, float value) |
void | setSceneManager (Ogre::SceneManager *scenemanager) |
void | setVisible (bool bVisible) |
Shader (Ogre::SceneManager *scenemanager=0) | |
virtual void | tick (float dt) |
Gets called every frame. | |
void | updateVisibility () |
virtual | ~Shader () |
Static Public Member Functions | |
static bool | _setParameter (const std::string &material, size_t technique, size_t pass, const std::string ¶meter, int value) |
static bool | _setParameter (const std::string &material, size_t technique, size_t pass, const std::string ¶meter, float value) |
static float | getParameter (const std::string &material, size_t technique, size_t pass, const std::string ¶meter) |
static bool | getParameterIsFloat (const std::string &material, size_t technique, size_t pass, const std::string ¶meter) |
static bool | getParameterIsInt (const std::string &material, size_t technique, size_t pass, const std::string ¶meter) |
static ParameterPointer * | getParameterPointer (const std::string &material, size_t technique, size_t pass, const std::string ¶meter) |
Private Types | |
typedef std::map< std::string, TechniqueVector > | MaterialMap |
typedef std::map< std::string, ParameterPointer > | ParameterMap |
typedef std::pair< bool, void * > | ParameterPointer |
typedef std::vector< ParameterMap > | PassVector |
typedef std::vector< PassVector > | TechniqueVector |
Private Attributes | |
bool | bLoadCompositor_ |
bool | bViewportInitialized_ |
bool | bVisible_ |
std::string | compositor_ |
Ogre::CompositorInstance * | compositorInstance_ |
std::string | oldcompositor_ |
Ogre::SceneManager * | scenemanager_ |
Static Private Attributes | |
static bool | bLoadedCgPlugin_s = false |
static MaterialMap | parameters_s |
typedef std::map<std::string, TechniqueVector> orxonox::Shader::MaterialMap [private] |
typedef std::map<std::string, ParameterPointer> orxonox::Shader::ParameterMap [private] |
typedef std::pair<bool, void*> orxonox::Shader::ParameterPointer [private] |
typedef std::vector<ParameterMap> orxonox::Shader::PassVector [private] |
typedef std::vector<PassVector> orxonox::Shader::TechniqueVector [private] |
orxonox::Shader::Shader | ( | Ogre::SceneManager * | scenemanager = 0 |
) |
orxonox::Shader::~Shader | ( | ) | [virtual] |
bool orxonox::Shader::_setParameter | ( | const std::string & | material, | |
size_t | technique, | |||
size_t | pass, | |||
const std::string & | parameter, | |||
int | value | |||
) | [static] |
References getParameterPointer().
bool orxonox::Shader::_setParameter | ( | const std::string & | material, | |
size_t | technique, | |||
size_t | pass, | |||
const std::string & | parameter, | |||
float | value | |||
) | [static] |
void orxonox::Shader::changedCompositor | ( | ) |
const std::string& orxonox::Shader::getCompositor | ( | ) | const [inline] |
Referenced by orxonox::GlobalShader::registerVariables().
float orxonox::Shader::getParameter | ( | const std::string & | material, | |
size_t | technique, | |||
size_t | pass, | |||
const std::string & | parameter | |||
) | [static] |
References getParameterPointer().
bool orxonox::Shader::getParameterIsFloat | ( | const std::string & | material, | |
size_t | technique, | |||
size_t | pass, | |||
const std::string & | parameter | |||
) | [static] |
References getParameterPointer().
bool orxonox::Shader::getParameterIsInt | ( | const std::string & | material, | |
size_t | technique, | |||
size_t | pass, | |||
const std::string & | parameter | |||
) | [static] |
References getParameterPointer().
Shader::ParameterPointer * orxonox::Shader::getParameterPointer | ( | const std::string & | material, | |
size_t | technique, | |||
size_t | pass, | |||
const std::string & | parameter | |||
) | [static] |
References bLoadedCgPlugin_s, COUT, parameters_s, and orxonox::GameMode::showsGraphics().
Referenced by _setParameter(), getParameter(), getParameterIsFloat(), and getParameterIsInt().
Ogre::SceneManager* orxonox::Shader::getSceneManager | ( | ) | const [inline] |
bool orxonox::Shader::isVisible | ( | ) | const [inline] |
Referenced by changedCompositor(), setParameter(), and updateVisibility().
void orxonox::Shader::setCompositor | ( | const std::string & | compositor | ) | [inline] |
Referenced by orxonox::Engine::tick().
void orxonox::Shader::setParameter | ( | const std::string & | material, | |
size_t | technique, | |||
size_t | pass, | |||
const std::string & | parameter, | |||
int | value | |||
) |
References _setParameter(), bViewportInitialized_, compositorInstance_, and isVisible().
void orxonox::Shader::setParameter | ( | const std::string & | material, | |
size_t | technique, | |||
size_t | pass, | |||
const std::string & | parameter, | |||
float | value | |||
) |
References _setParameter(), bViewportInitialized_, compositorInstance_, and isVisible().
Referenced by orxonox::Engine::tick().
void orxonox::Shader::setSceneManager | ( | Ogre::SceneManager * | scenemanager | ) |
References bViewportInitialized_, and scenemanager_.
Referenced by orxonox::GlobalShader::GlobalShader().
void orxonox::Shader::setVisible | ( | bool | bVisible | ) | [inline] |
Referenced by orxonox::Engine::changedActivity(), and orxonox::GlobalShader::changedVisibility().
void orxonox::Shader::tick | ( | float | dt | ) | [virtual] |
Gets called every frame.
dt | The time since the last frame in seconds |
Implements orxonox::Tickable.
References bLoadCompositor_, bViewportInitialized_, scenemanager_, SUPER, and updateVisibility().
void orxonox::Shader::updateVisibility | ( | ) |
bool orxonox::Shader::bLoadCompositor_ [private] |
Referenced by changedCompositor(), Shader(), tick(), and ~Shader().
bool orxonox::Shader::bLoadedCgPlugin_s = false [static, private] |
Referenced by getParameterPointer(), and Shader().
bool orxonox::Shader::bViewportInitialized_ [private] |
Referenced by changedCompositor(), setParameter(), setSceneManager(), Shader(), and tick().
bool orxonox::Shader::bVisible_ [private] |
Referenced by Shader().
std::string orxonox::Shader::compositor_ [private] |
Referenced by changedCompositor(), Shader(), and ~Shader().
Ogre::CompositorInstance* orxonox::Shader::compositorInstance_ [private] |
Referenced by changedCompositor(), setParameter(), Shader(), updateVisibility(), and ~Shader().
std::string orxonox::Shader::oldcompositor_ [private] |
Referenced by changedCompositor(), and Shader().
Shader::MaterialMap orxonox::Shader::parameters_s [static, private] |
Referenced by getParameterPointer().
Ogre::SceneManager* orxonox::Shader::scenemanager_ [private] |
Referenced by setSceneManager(), Shader(), tick(), and updateVisibility().