Orxonox  0.0.5 Codename: Arcturus
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
orxonox::GraphicsManager Class Reference

Graphics engine manager class. More...

#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/libraries/core/GraphicsManager.h>

Inheritance diagram for orxonox::GraphicsManager:
orxonox::Singleton< GraphicsManager > orxonox::Configurable orxonox::Listable orxonox::Identifiable

Public Member Functions

 GraphicsManager (bool bLoadRenderer=true)
 
 ~GraphicsManager ()=default
 Leave empty and use cleanup() instead. More...
 
void destroy ()
 Destructor that also executes when object fails to construct. More...
 
std::string getFSAAMode () const
 
Ogre::OverlaySystem * getOverlaySystem ()
 
Ogre::RenderWindow * getRenderWindow ()
 
size_t getRenderWindowHandle ()
 
Ogre::Viewport * getViewport ()
 
unsigned int getWindowHeight () const
 
unsigned int getWindowWidth () const
 
bool hasVSyncEnabled () const
 
bool isFullScreen () const
 
void loadDebugOverlay ()
 
void postUpdate (const Clock &time)
 
bool rendererLoaded () const
 
void setCamera (Ogre::Camera *camera)
 
void setConfigValues ()
 
void unloadDebugOverlay ()
 
void upgradeToGraphics ()
 Loads the renderer and creates the render window if not yet done so. More...
 
- Public Member Functions inherited from orxonox::Configurable
 Configurable ()
 
void setConfigValues ()
 Function to collect the SetConfigValue-macro calls. More...
 
- Public Member Functions inherited from orxonox::Listable
 Listable ()
 Constructor: Allocates space in the element list. More...
 
 Listable (Context *context)
 Constructor: Allocates space in the element list and assigns the context. More...
 
virtual ~Listable ()
 Destructor: Removes the object from the object-lists. More...
 
ContextgetContext () const
 
void setContext (Context *context)
 Changes the context. More...
 
void unregisterObject ()
 Removes this object from the object-lists. More...
 
- Public Member Functions inherited from orxonox::Identifiable
 Identifiable ()
 Constructor: Sets the default values. More...
 
virtual ~Identifiable ()
 
ORX_FORCEINLINE voidgetDerivedPointer (unsigned int classID)
 Returns a valid pointer of any derived type that is registered in the class hierarchy. More...
 
template<class T >
ORX_FORCEINLINE T * getDerivedPointer (unsigned int classID)
 Version of getDerivedPointer with template. More...
 
template<class T >
ORX_FORCEINLINE const T * getDerivedPointer (unsigned int classID) const
 Const version of getDerivedPointer with template. More...
 
IdentifiergetIdentifier () const
 Returns the Identifier of the object. More...
 
bool isA (const Identifier *identifier)
 Returns true if the object's class is of the given type or a derivative. More...
 
template<class B >
bool isA (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is of the given type or a derivative. More...
 
bool isA (const Identifiable *object)
 Returns true if the object's class is of the given type or a derivative. More...
 
bool isChildOf (const Identifier *identifier)
 Returns true if the object's class is a child of the given type. More...
 
template<class B >
bool isChildOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a child of the given type. More...
 
bool isChildOf (const Identifiable *object)
 Returns true if the object's class is a child of the given type. More...
 
bool isDirectChildOf (const Identifier *identifier)
 Returns true if the object's class is a direct child of the given type. More...
 
template<class B >
bool isDirectChildOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a direct child of the given type. More...
 
bool isDirectChildOf (const Identifiable *object)
 Returns true if the object's class is a direct child of the given type. More...
 
bool isDirectParentOf (const Identifier *identifier)
 Returns true if the object's class is a direct parent of the given type. More...
 
template<class B >
bool isDirectParentOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a direct parent of the given type. More...
 
bool isDirectParentOf (const Identifiable *object)
 Returns true if the object's class is a direct child of the given type. More...
 
bool isExactlyA (const Identifier *identifier)
 Returns true if the object's class is exactly of the given type. More...
 
template<class B >
bool isExactlyA (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is exactly of the given type. More...
 
bool isExactlyA (const Identifiable *object)
 Returns true if the object's class is exactly of the given type. More...
 
bool isParentOf (const Identifier *identifier)
 Returns true if the object's class is a parent of the given type. More...
 
template<class B >
bool isParentOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a parent of the given type. More...
 
bool isParentOf (const Identifiable *object)
 Returns true if the object's class is a parent of the given type. More...
 

Static Public Member Functions

static GraphicsManagergetInstance ()
 
- Static Public Member Functions inherited from orxonox::Singleton< GraphicsManager >
static bool exists ()
 Tells whether the singleton has been created. More...
 
static GraphicsManagergetInstance ()
 Returns a reference to the singleton instance. More...
 

Private Member Functions

 GraphicsManager (const GraphicsManager &)=delete
 
void loadOgrePlugins ()
 
void loadOgreRoot ()
 Creates the Ogre Root object and sets up the ogre log. More...
 
void loadRenderer ()
 
virtual void messageLogged (const std::string &message, Ogre::LogMessageLevel lml, bool maskDebug, const std::string &logName) override
 Method called by the LogListener interface from Ogre. More...
 
GraphicsManageroperator= (const GraphicsManager &)=delete
 
void printScreen ()
 
std::string setFSAA (const std::string &mode)
 
std::string setScreenResolution (unsigned int width, unsigned int height, bool fullscreen)
 
std::string setVSync (bool vsync)
 

Private Attributes

std::shared_ptr< XMLFiledebugOverlay_
 XML with various debug overlays. More...
 
DestructionHelper< GraphicsManagerdestructionHelper_
 Helper object that executes the surrogate destructor destroy() More...
 
std::shared_ptr< XMLFileextResources_
 XML with resource locations in the external path (only for dev runs) More...
 
GlowMaterialListenerglowMaterialListener_
 Material Listener for the 'Glow' compositor. More...
 
float lastFrameEndTime_
 Time stamp of the end of the last frame. More...
 
float lastFrameStartTime_
 Time stamp of the beginning of the last frame. More...
 
std::string ogreConfigFile_
 ogre config filename More...
 
std::string ogreLogFile_
 log filename for Ogre log messages More...
 
Ogre::LogManager * ogreLogger_
 
std::string ogrePlugins_
 Comma separated list of all plugins to load. More...
 
Ogre::Root * ogreRoot_
 Ogre's root. More...
 
OgreWindowEventListenerogreWindowEventListener_
 Pimpl to hide OgreWindowUtilities.h. More...
 
Ogre::OverlaySystem * overlaySystem_
 
Ogre::RenderWindow * renderWindow_
 the one and only render window More...
 
std::shared_ptr< XMLFileresources_
 XML with resource locations. More...
 
Ogre::Viewport * viewport_
 default full size viewport More...
 

Static Private Attributes

static GraphicsManagersingletonPtr_s = nullptr
 Pointer to the Singleton. More...
 

Friends

class Singleton< GraphicsManager >
 

Additional Inherited Members

- Protected Member Functions inherited from orxonox::Singleton< GraphicsManager >
 Singleton ()
 Constructor sets the singleton instance pointer. More...
 
virtual ~Singleton ()
 Destructor resets the singleton instance pointer. More...
 

Detailed Description

Graphics engine manager class.

Constructor & Destructor Documentation

orxonox::GraphicsManager::GraphicsManager ( bool  bLoadRenderer = true)
orxonox::GraphicsManager::~GraphicsManager ( )
default

Leave empty and use cleanup() instead.

orxonox::GraphicsManager::GraphicsManager ( const GraphicsManager )
privatedelete

Member Function Documentation

void orxonox::GraphicsManager::destroy ( )

Destructor that also executes when object fails to construct.

std::string orxonox::GraphicsManager::getFSAAMode ( ) const
static GraphicsManager& orxonox::GraphicsManager::getInstance ( )
inlinestatic
Ogre::OverlaySystem* orxonox::GraphicsManager::getOverlaySystem ( )
inline
Ogre::RenderWindow* orxonox::GraphicsManager::getRenderWindow ( )
inline
size_t orxonox::GraphicsManager::getRenderWindowHandle ( )
Ogre::Viewport* orxonox::GraphicsManager::getViewport ( )
inline
unsigned int orxonox::GraphicsManager::getWindowHeight ( ) const
unsigned int orxonox::GraphicsManager::getWindowWidth ( ) const
bool orxonox::GraphicsManager::hasVSyncEnabled ( ) const
bool orxonox::GraphicsManager::isFullScreen ( ) const
void orxonox::GraphicsManager::loadDebugOverlay ( )
void orxonox::GraphicsManager::loadOgrePlugins ( )
private
void orxonox::GraphicsManager::loadOgreRoot ( )
private

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

void orxonox::GraphicsManager::loadRenderer ( )
private
void orxonox::GraphicsManager::messageLogged ( const std::string &  message,
Ogre::LogMessageLevel  lml,
bool  maskDebug,
const std::string &  logName 
)
overrideprivatevirtual

Method called by the LogListener interface from Ogre.

We use it to capture Ogre log messages and handle it ourselves.

Parameters
messageThe message to be logged
lmlThe message level the log is using
maskDebugIf we are printing to the console or not
logNameThe name of this log (so you can have several listeners for different logs, and identify them)
skipThisMessageIf set to true by the messageLogged() implementation message will not be logged
GraphicsManager& orxonox::GraphicsManager::operator= ( const GraphicsManager )
privatedelete
void orxonox::GraphicsManager::postUpdate ( const Clock time)
Note
A note about the Ogre::FrameListener: Even though we don't use them, they still get called.
void orxonox::GraphicsManager::printScreen ( )
private
bool orxonox::GraphicsManager::rendererLoaded ( ) const
inline
void orxonox::GraphicsManager::setCamera ( Ogre::Camera *  camera)
void orxonox::GraphicsManager::setConfigValues ( void  )
std::string orxonox::GraphicsManager::setFSAA ( const std::string &  mode)
private
std::string orxonox::GraphicsManager::setScreenResolution ( unsigned int  width,
unsigned int  height,
bool  fullscreen 
)
private
std::string orxonox::GraphicsManager::setVSync ( bool  vsync)
private
void orxonox::GraphicsManager::unloadDebugOverlay ( )
void orxonox::GraphicsManager::upgradeToGraphics ( )

Loads the renderer and creates the render window if not yet done so.

Remarks
This operation is irreversible without recreating the GraphicsManager! So if it throws you HAVE to recreate the GraphicsManager!!! It therefore offers almost no exception safety.

Friends And Related Function Documentation

friend class Singleton< GraphicsManager >
friend

Member Data Documentation

std::shared_ptr<XMLFile> orxonox::GraphicsManager::debugOverlay_
private

XML with various debug overlays.

DestructionHelper<GraphicsManager> orxonox::GraphicsManager::destructionHelper_
private

Helper object that executes the surrogate destructor destroy()

std::shared_ptr<XMLFile> orxonox::GraphicsManager::extResources_
private

XML with resource locations in the external path (only for dev runs)

GlowMaterialListener* orxonox::GraphicsManager::glowMaterialListener_
private

Material Listener for the 'Glow' compositor.

float orxonox::GraphicsManager::lastFrameEndTime_
private

Time stamp of the end of the last frame.

float orxonox::GraphicsManager::lastFrameStartTime_
private

Time stamp of the beginning of the last frame.

std::string orxonox::GraphicsManager::ogreConfigFile_
private

ogre config filename

std::string orxonox::GraphicsManager::ogreLogFile_
private

log filename for Ogre log messages

Ogre::LogManager* orxonox::GraphicsManager::ogreLogger_
private
std::string orxonox::GraphicsManager::ogrePlugins_
private

Comma separated list of all plugins to load.

Ogre::Root* orxonox::GraphicsManager::ogreRoot_
private

Ogre's root.

OgreWindowEventListener* orxonox::GraphicsManager::ogreWindowEventListener_
private

Pimpl to hide OgreWindowUtilities.h.

Ogre::OverlaySystem* orxonox::GraphicsManager::overlaySystem_
private
Ogre::RenderWindow* orxonox::GraphicsManager::renderWindow_
private

the one and only render window

std::shared_ptr<XMLFile> orxonox::GraphicsManager::resources_
private

XML with resource locations.

GraphicsManager * orxonox::GraphicsManager::singletonPtr_s = nullptr
staticprivate

Pointer to the Singleton.

Ogre::Viewport* orxonox::GraphicsManager::viewport_
private

default full size viewport


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