Orxonox: orxonox::GraphicsManager Class Reference

# orxonox::GraphicsManager Class Reference

Graphics engine manager class. More...

`#include <src/orxonox/GraphicsManager.h>`

Inheritance diagram for orxonox::GraphicsManager:

List of all members.

## Public Member Functions

void | detailLevelParticleChanged ()
unsigned int | getDetailLevelParticle () const
Ogre::RenderWindow * | getRenderWindow ()
Ogre::Viewport * | getViewport ()
| GraphicsManager ()
| Non-initialising constructor.
void | setCamera (Ogre::Camera *camera)
void | setConfigValues ()
| Function to collect the SetConfigValue-macro calls.
void | update (const Clock &time)
| ~GraphicsManager ()
| Destroys all the Ogre related objects.

## Static Public Member Functions

static GraphicsManager & | getInstance ()

## Private Member Functions

void | declareResources ()
| GraphicsManager (GraphicsManager &)
void | initialiseResources ()
void | loadOgrePlugins ()
void | loadRenderer ()
void | messageLogged (const std::string &message, Ogre::LogMessageLevel lml, bool maskDebug, const std::string &logName)
| Method called by the LogListener interface from Ogre. We use it to capture Ogre log messages and handle it ourselves.
void | printScreen ()
void | setupOgre ()
| Creates the Ogre Root object and sets up the ogre log.

## Private Attributes

ConsoleCommand * | ccPrintScreen_
unsigned int | detailLevelParticle_
| Detail level of particle effects (0: off, 1: low, 2: normal, 3: high).
std::string | ogreConfigFile_
| ogre config file name
std::string | ogreLogFile_
| log file name for Ogre log messages
Ogre::LogManager * | ogreLogger_
int | ogreLogLevelCritical_
| Corresponding Orxonx debug level for LL_CRITICAL.
int | ogreLogLevelNormal_
| Corresponding Orxonx debug level for LL_NORMAL.
int | ogreLogLevelTrivial_
| Corresponding Orxonx debug level for LL_TRIVIAL.
std::string | ogrePlugins_
| Comma separated list of all plugins to load.
std::string | ogrePluginsFolder_
| Folder where the Ogre plugins are located.
Ogre::Root * | ogreRoot_
| Ogre's root.
OgreWindowEventListener * | ogreWindowEventListener_
| Pimpl to hide OgreWindowUtilities.h.
Ogre::RenderWindow * | renderWindow_
| the one and only render window
std::string | resourceFile_
| resources file name
Ogre::Viewport * | viewport_
| default full size viewport

## Static Private Attributes

static GraphicsManager * | singletonRef_s = 0
| Pointer to the Singleton.

## Detailed Description

Graphics engine manager class.

## Constructor & Destructor Documentation

orxonox::GraphicsManager::GraphicsManager | ( |  | ) |

Non-initialising constructor.

References orxonox::CommandExecutor::addConsoleCommandShortcut(), ccPrintScreen_, orxonox::createConsoleCommand(), declareResources(), initialiseResources(), loadOgrePlugins(), loadRenderer(), ogreLogger_, ogreRoot_, ogreWindowEventListener_, printScreen(), RegisterObject, setConfigValues(), orxonox::FunctorMember< T >::setObject(), setupOgre(), and singletonRef_s.

orxonox::GraphicsManager::~GraphicsManager | ( |  | ) |

Destroys all the Ogre related objects.

References orxonox::Map::hackDestroyMap(), ogreLogger_, ogreRoot_, ogreWindowEventListener_, and singletonRef_s.

orxonox::GraphicsManager::GraphicsManager | ( | GraphicsManager & |  | ) | `[private]`

## Member Function Documentation

void orxonox::GraphicsManager::declareResources | ( |  | ) | `[private]`

References CCOUT, COUT, orxonox::Core::getMediaPath(), ModifyConfigValue, and resourceFile_.

Referenced by GraphicsManager().

void orxonox::GraphicsManager::detailLevelParticleChanged | ( |  | ) |

Referenced by setConfigValues().

unsigned int orxonox::GraphicsManager::getDetailLevelParticle | ( |  | ) | const`[inline]`

static GraphicsManager& orxonox::GraphicsManager::getInstance | ( |  | ) | `[inline, static]`

Referenced by orxonox::GSMainMenu::activate(), orxonox::GSLevel::activate(), orxonox::GSGraphics::activate(), orxonox::Shader::changedCompositor(), orxonox::GSMainMenu::deactivate(), orxonox::ParticleInterface::setDetailLevel(), and orxonox::Shader::~Shader().

Ogre::RenderWindow* orxonox::GraphicsManager::getRenderWindow | ( |  | ) | `[inline]`

Referenced by orxonox::GSGraphics::activate().

Ogre::Viewport* orxonox::GraphicsManager::getViewport | ( |  | ) | `[inline]`

Referenced by orxonox::Shader::changedCompositor(), and orxonox::Shader::~Shader().

void orxonox::GraphicsManager::initialiseResources | ( |  | ) | `[private]`

References CCOUT.

Referenced by GraphicsManager().

void orxonox::GraphicsManager::loadOgrePlugins | ( |  | ) | `[private]`

References ogrePlugins_, ogrePluginsFolder_, ogreRoot_, and orxonox::SubString::size().

Referenced by GraphicsManager().

void orxonox::GraphicsManager::loadRenderer | ( |  | ) | `[private]`

References CCOUT, ogreRoot_, ogreWindowEventListener_, renderWindow_, ThrowException, and viewport_.

Referenced by GraphicsManager().

void orxonox::GraphicsManager::messageLogged | ( | const std::string & | message,
|  | Ogre::LogMessageLevel | lml,
|  | bool | maskDebug,
|  | const std::string & | logName |
| ) |  |  | `[private]`

Method called by the LogListener interface from Ogre. We use it to capture Ogre log messages and handle it ourselves.

Parameters:

  | message | The message to be logged
  | lml | The message level the log is using
  | maskDebug | If we are printing to the console or not
  | logName | The name of this log (so you can have several listeners for different logs, and identify them)

References orxonox::OutputHandler::getOutStream(), ogreLogLevelCritical_, ogreLogLevelNormal_, ogreLogLevelTrivial_, and orxonox::OutputHandler::setOutputLevel().

void orxonox::GraphicsManager::printScreen | ( |  | ) | `[private]`

References orxonox::Core::getLogPathString(), and renderWindow_.

Referenced by GraphicsManager().

void orxonox::GraphicsManager::setCamera | ( | Ogre::Camera * | camera | ) |

References viewport_.

Referenced by orxonox::GSMainMenu::activate(), and orxonox::GSMainMenu::deactivate().

void orxonox::GraphicsManager::setConfigValues | ( |  | ) |

Function to collect the SetConfigValue-macro calls.

Reimplemented from orxonox::OrxonoxClass.

References detailLevelParticle_, detailLevelParticleChanged(), ogreConfigFile_, ogreLogFile_, ogreLogLevelCritical_, ogreLogLevelNormal_, ogreLogLevelTrivial_, ogrePlugins_, ogrePluginsFolder_, orxonox::ORXONOX_OGRE_PLUGINS, orxonox::ORXONOX_OGRE_PLUGINS_FOLDER, resourceFile_, and SetConfigValue.

Referenced by GraphicsManager().

void orxonox::GraphicsManager::setupOgre | ( |  | ) | `[private]`

Creates the Ogre Root object and sets up the ogre log.

References COUT, orxonox::Core::getConfigPath(), orxonox::Core::getLogPath(), ModifyConfigValue, ogreConfigFile_, ogreLogFile_, ogreLogger_, and ogreRoot_.

Referenced by GraphicsManager().

void orxonox::GraphicsManager::update | ( | const Clock & | time | ) |

References orxonox::Clock::getDeltaTime(), ogreRoot_, and renderWindow_.

Referenced by orxonox::GSGraphics::update().

## Member Data Documentation

ConsoleCommand* orxonox::GraphicsManager::ccPrintScreen_`[private]`

Referenced by GraphicsManager().

unsigned int orxonox::GraphicsManager::detailLevelParticle_`[private]`

Detail level of particle effects (0: off, 1: low, 2: normal, 3: high).

Referenced by setConfigValues().

std::string orxonox::GraphicsManager::ogreConfigFile_`[private]`

ogre config file name

Referenced by setConfigValues(), and setupOgre().

std::string orxonox::GraphicsManager::ogreLogFile_`[private]`

log file name for Ogre log messages

Referenced by setConfigValues(), and setupOgre().

Ogre::LogManager* orxonox::GraphicsManager::ogreLogger_`[private]`

Referenced by GraphicsManager(), setupOgre(), and ~GraphicsManager().

int orxonox::GraphicsManager::ogreLogLevelCritical_`[private]`

Corresponding Orxonx debug level for LL_CRITICAL.

Referenced by messageLogged(), and setConfigValues().

int orxonox::GraphicsManager::ogreLogLevelNormal_`[private]`

Corresponding Orxonx debug level for LL_NORMAL.

Referenced by messageLogged(), and setConfigValues().

int orxonox::GraphicsManager::ogreLogLevelTrivial_`[private]`

Corresponding Orxonx debug level for LL_TRIVIAL.

Referenced by messageLogged(), and setConfigValues().

std::string orxonox::GraphicsManager::ogrePlugins_`[private]`

Comma separated list of all plugins to load.

Referenced by loadOgrePlugins(), and setConfigValues().

std::string orxonox::GraphicsManager::ogrePluginsFolder_`[private]`

Folder where the Ogre plugins are located.

Referenced by loadOgrePlugins(), and setConfigValues().

Ogre::Root* orxonox::GraphicsManager::ogreRoot_`[private]`

Ogre's root.

Referenced by GraphicsManager(), loadOgrePlugins(), loadRenderer(), setupOgre(), update(), and ~GraphicsManager().

OgreWindowEventListener* orxonox::GraphicsManager::ogreWindowEventListener_`[private]`

Pimpl to hide OgreWindowUtilities.h.

Referenced by GraphicsManager(), loadRenderer(), and ~GraphicsManager().

Ogre::RenderWindow* orxonox::GraphicsManager::renderWindow_`[private]`

the one and only render window

Referenced by loadRenderer(), printScreen(), and update().

std::string orxonox::GraphicsManager::resourceFile_`[private]`

resources file name

Referenced by declareResources(), and setConfigValues().

GraphicsManager * orxonox::GraphicsManager::singletonRef_s = 0`[static, private]`

Pointer to the Singleton.

Referenced by GraphicsManager(), and ~GraphicsManager().

Ogre::Viewport* orxonox::GraphicsManager::viewport_`[private]`

default full size viewport

Referenced by loadRenderer(), and setCamera().

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

- src/orxonox/GraphicsManager.h
- src/orxonox/GraphicsManager.cc