Orxonox: orxonox::Shader Class Reference

# orxonox::Shader Class Reference

`#include <src/orxonox/tools/Shader.h>`

Inheritance diagram for orxonox::Shader:

List of all members.

## 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 &parameter, int value)
void | setParameter (const std::string &material, size_t technique, size_t pass, const std::string &parameter, 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 &parameter, int value)
static bool | _setParameter (const std::string &material, size_t technique, size_t pass, const std::string &parameter, float value)
static float | getParameter (const std::string &material, size_t technique, size_t pass, const std::string &parameter)
static bool | getParameterIsFloat (const std::string &material, size_t technique, size_t pass, const std::string &parameter)
static bool | getParameterIsInt (const std::string &material, size_t technique, size_t pass, const std::string &parameter)
static ParameterPointer * | getParameterPointer (const std::string &material, size_t technique, size_t pass, const std::string &parameter)

## 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

## Member Typedef Documentation

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]`

## Constructor & Destructor Documentation

orxonox::Shader::Shader | ( | Ogre::SceneManager * | scenemanager = `0` | ) |

References bLoadCompositor_, bLoadedCgPlugin_s, bViewportInitialized_, bVisible_, compositor_, compositorInstance_, oldcompositor_, RegisterObject, scenemanager_, and orxonox::GameMode::showsGraphics().

orxonox::Shader::~Shader | ( |  | ) | `[virtual]`

References bLoadCompositor_, compositor_, compositorInstance_, orxonox::GraphicsManager::getInstance(), and orxonox::GraphicsManager::getViewport().

## Member Function Documentation

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]`

References getParameterPointer().

Referenced by setParameter().

void orxonox::Shader::changedCompositor | ( |  | ) |

References bLoadCompositor_, bViewportInitialized_, compositor_, compositorInstance_, COUT, orxonox::GraphicsManager::getInstance(), orxonox::GraphicsManager::getViewport(), isVisible(), and oldcompositor_.

Referenced by orxonox::GlobalShader::registerVariables().

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.

Parameters:

  | dt | The time since the last frame in seconds

Implements orxonox::Tickable.

References bLoadCompositor_, bViewportInitialized_, scenemanager_, SUPER, and updateVisibility().

void orxonox::Shader::updateVisibility | ( |  | ) |

References compositorInstance_, isVisible(), and scenemanager_.

Referenced by tick().

## Member Data Documentation

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().

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

- src/orxonox/tools/Shader.h
- src/orxonox/tools/Shader.cc