OGRE-Next: Ogre::v1::OverlayManager Class Reference

| OGRE-Next 3.0.0 Object-Oriented Graphics Rendering Engine

Loading...
Searching...
No Matches
Ogre::v1::OverlayManager Class Reference
Core » Overlays

Manages Overlay objects, parsing them from .overlay files and storing a lookup library of them. More...

`#include <OgreOverlayManager.h>`

Inheritance diagram for Ogre::v1::OverlayManager:
[legend]

## Public Types
typedef map< String, OverlayElement * >::type | ElementMap
typedef map< String, OverlayElementFactory * >::type | FactoryMap
typedef map< String, Overlay * >::type | OverlayMap
typedef MapIterator< OverlayMap > | OverlayMapIterator
typedef MapIterator< ElementMap > | TemplateIterator

## Public Member Functions
| OverlayManager ()
| ~OverlayManager () override
void | _queueOverlaysForRendering (RenderQueue *pQueue, Viewport *vp)
| Internal method for queueing the visible overlays for rendering.
void | _releaseManualHardwareResources ()
| Notifies that hardware resources were lost.
void | _restoreManualHardwareResources ()
| Notifies that hardware resources should be restored.
void | addOverlayElementFactory (OverlayElementFactory *elemFactory)
| Registers a new OverlayElementFactory with this manager.
OverlayElement * | cloneOverlayElementFromTemplate (const String &templateName, const String &instanceName)
Overlay * | create (const String &name)
| Create a new Overlay.
OverlayElement * | createOverlayElement (const String &typeName, const String &instanceName, bool isTemplate=false)
| Creates a new OverlayElement of the type requested.
OverlayElement * | createOverlayElementFromFactory (const String &typeName, const String &instanceName)
OverlayElement * | createOverlayElementFromTemplate (const String &templateName, const String &typeName, const String &instanceName, bool isTemplate=false)
void | destroy (const String &name)
| Destroys an existing overlay by name.
void | destroy (Overlay *overlay)
| Destroys an existing overlay.
void | destroyAll ()
| Destroys all existing overlays.
void | destroyAllOverlayElements (bool isTemplate=false)
| Destroys all the OverlayElement created so far.
void | destroyOverlayElement (const String &instanceName, bool isTemplate=false)
| Destroys a OverlayElement.
void | destroyOverlayElement (OverlayElement *pInstance, bool isTemplate=false)
| Destroys a OverlayElement.
Overlay * | getByName (const String &name)
| Retrieve an Overlay by name.
Real | getLoadingOrder () const override
| Gets the relative loading order of scripts of this type.
OverlayElement * | getOverlayElement (const String &name, bool isTemplate=false)
| Gets a reference to an existing element.
const FactoryMap & | getOverlayElementFactoryMap () const
| Get const access to the list of registered OverlayElement factories.
OverlayMapIterator | getOverlayIterator ()
const StringVector & | getScriptPatterns () const override
| Gets the file patterns which should be used to find scripts for this class.
TemplateIterator | getTemplateIterator ()
| Returns an iterator over all templates in this manager.
Real | getViewportAspectRatio () const
int | getViewportHeight () const
| Gets the height of the destination viewport in pixels.
int | getViewportWidth () const
| Gets the width of the destination viewport in pixels.
bool | hasOverlayElement (const String &name, bool isTemplate=false)
| Tests if an element exists.
bool | isTemplate (String strName) const
void | parseScript (DataStreamPtr &stream, const String &groupName) override
| Parse a script file.
Public Member Functions inherited from Ogre::Singleton< OverlayManager >
| ~Singleton ()
Public Member Functions inherited from Ogre::ScriptLoader
virtual | ~ScriptLoader ()

## Static Public Member Functions
static OverlayManager & | getSingleton ()
| Override standard Singleton retrieval.
static OverlayManager * | getSingletonPtr ()
| Override standard Singleton retrieval.
Static Public Member Functions inherited from Ogre::Singleton< OverlayManager >
static OverlayManager & | getSingleton ()
static OverlayManager * | getSingletonPtr ()

## Public Attributes
uint8 | mDefaultRenderQueueId

## Detailed Description

Manages Overlay objects, parsing them from .overlay files and storing a lookup library of them.

Also manages the creation of OverlayContainers and OverlayElements, used for non-interactive 2D elements such as HUDs.

## Member Typedef Documentation

## ◆ ElementMap

typedef map<String,OverlayElement*>::type Ogre::v1::OverlayManager::ElementMap

## ◆ FactoryMap

typedef map<String,OverlayElementFactory*>::type Ogre::v1::OverlayManager::FactoryMap

## ◆ OverlayMap

typedef map<String,Overlay*>::type Ogre::v1::OverlayManager::OverlayMap

## ◆ OverlayMapIterator

typedef MapIterator<OverlayMap> Ogre::v1::OverlayManager::OverlayMapIterator

## ◆ TemplateIterator

typedef MapIterator<ElementMap> Ogre::v1::OverlayManager::TemplateIterator

## Constructor & Destructor Documentation

## ◆ OverlayManager()

Ogre::v1::OverlayManager::OverlayManager | ( |  | ) |

Referenced by getSingleton(), and getSingletonPtr().

## ◆ ~OverlayManager()

Ogre::v1::OverlayManager::~OverlayManager | ( |  | ) |
| override

## Member Function Documentation

## ◆ _queueOverlaysForRendering()

void Ogre::v1::OverlayManager::_queueOverlaysForRendering | ( | RenderQueue * | pQueue,
|  | Viewport * | vp )

Internal method for queueing the visible overlays for rendering.

## ◆ _releaseManualHardwareResources()

void Ogre::v1::OverlayManager::_releaseManualHardwareResources | ( |  | ) |

Notifies that hardware resources were lost.

## ◆ _restoreManualHardwareResources()

void Ogre::v1::OverlayManager::_restoreManualHardwareResources | ( |  | ) |

Notifies that hardware resources should be restored.

## ◆ addOverlayElementFactory()

void Ogre::v1::OverlayManager::addOverlayElementFactory | ( | OverlayElementFactory * | elemFactory | ) |

Registers a new OverlayElementFactory with this manager.

Remarks
  Should be used by plugins or other apps wishing to provide a new OverlayElement subclass.

## ◆ cloneOverlayElementFromTemplate()

OverlayElement * Ogre::v1::OverlayManager::cloneOverlayElementFromTemplate | ( | const String & | templateName,
|  | const String & | instanceName )

Remarks
  Creates a new OverlayElement object from the specified template name. The new object's name, and all of it's children, will be instanceName/orignalName.

## ◆ create()

Overlay * Ogre::v1::OverlayManager::create | ( | const String & | name | ) |

Create a new Overlay.

## ◆ createOverlayElement()

OverlayElement * Ogre::v1::OverlayManager::createOverlayElement | ( | const String & | typeName,
|  | const String & | instanceName,
|  | bool | isTemplate = false )

Creates a new OverlayElement of the type requested.

Remarks
  The type of element to create is passed in as a string because this allows plugins to register new types of component.

Parameters

  typeName | The type of element to create.
  instanceName | The name to give the new instance.

References isTemplate().

## ◆ createOverlayElementFromFactory()

OverlayElement * Ogre::v1::OverlayManager::createOverlayElementFromFactory | ( | const String & | typeName,
|  | const String & | instanceName )

## ◆ createOverlayElementFromTemplate()

OverlayElement * Ogre::v1::OverlayManager::createOverlayElementFromTemplate | ( | const String & | templateName,
|  | const String & | typeName,
|  | const String & | instanceName,
|  | bool | isTemplate = false )

References isTemplate().

## ◆ destroy() [1/2]

void Ogre::v1::OverlayManager::destroy | ( | const String & | name | ) |

Destroys an existing overlay by name.

## ◆ destroy() [2/2]

void Ogre::v1::OverlayManager::destroy | ( | Overlay * | overlay | ) |

Destroys an existing overlay.

## ◆ destroyAll()

void Ogre::v1::OverlayManager::destroyAll | ( |  | ) |

Destroys all existing overlays.

## ◆ destroyAllOverlayElements()

void Ogre::v1::OverlayManager::destroyAllOverlayElements | ( | bool | isTemplate = false | ) |

Destroys all the OverlayElement created so far.

Remarks
  Best to leave this to the engine to call internally, there should rarely be a need to call it yourself.

References isTemplate().

## ◆ destroyOverlayElement() [1/2]

void Ogre::v1::OverlayManager::destroyOverlayElement | ( | const String & | instanceName,
|  | bool | isTemplate = false )

Destroys a OverlayElement.

Remarks
  Make sure you're not still using this in an Overlay. If in doubt, let OGRE destroy elements on shutdown.

References isTemplate().

## ◆ destroyOverlayElement() [2/2]

void Ogre::v1::OverlayManager::destroyOverlayElement | ( | OverlayElement * | pInstance,
|  | bool | isTemplate = false )

Destroys a OverlayElement.

Remarks
  Make sure you're not still using this in an Overlay. If in doubt, let OGRE destroy elements on shutdown.

References isTemplate().

## ◆ getByName()

Overlay * Ogre::v1::OverlayManager::getByName | ( | const String & | name | ) |

Retrieve an Overlay by name.

Returns
  A pointer to the Overlay, or 0 if not found

## ◆ getLoadingOrder()

Real Ogre::v1::OverlayManager::getLoadingOrder | ( |  | ) | const
| overridevirtual

Gets the relative loading order of scripts of this type.

Remarks
  There are dependencies between some kinds of scripts, and to enforce this all implementors of this interface must define a loading order.

Returns
  A value representing the relative loading order of these scripts compared to other script users, where higher values load later.

Implements Ogre::ScriptLoader.

## ◆ getOverlayElement()

OverlayElement * Ogre::v1::OverlayManager::getOverlayElement | ( | const String & | name,
|  | bool | isTemplate = false )

Gets a reference to an existing element.

References isTemplate().

## ◆ getOverlayElementFactoryMap()

const FactoryMap & Ogre::v1::OverlayManager::getOverlayElementFactoryMap | ( |  | ) | const
| inline

Get const access to the list of registered OverlayElement factories.

## ◆ getOverlayIterator()

OverlayMapIterator Ogre::v1::OverlayManager::getOverlayIterator | ( |  | ) |

## ◆ getScriptPatterns()

const StringVector & Ogre::v1::OverlayManager::getScriptPatterns | ( |  | ) | const
| overridevirtual

Gets the file patterns which should be used to find scripts for this class.

Remarks
  This method is called when a resource group is loaded if you use ResourceGroupManager::_registerScriptLoader.

Returns
  A list of file patterns, in the order they should be searched in.

Implements Ogre::ScriptLoader.

## ◆ getSingleton()

OverlayManager & Ogre::v1::OverlayManager::getSingleton | ( |  | ) |
| static

Override standard Singleton retrieval.

Remarks
  Why do we do this? Well, it's because the Singleton implementation is in a .h file, which means it gets compiled into anybody who includes it. This is needed for the Singleton template to work, but we actually only want it compiled into the implementation of the class based on the Singleton, not all of them. If we don't change this, we get link errors when trying to use the Singleton-based class from an outside dll.

  This method just delegates to the template version anyway, but the implementation stays in this single compilation unit, preventing link errors.

References OverlayManager().

## ◆ getSingletonPtr()

OverlayManager * Ogre::v1::OverlayManager::getSingletonPtr | ( |  | ) |
| static

Override standard Singleton retrieval.

Remarks
  Why do we do this? Well, it's because the Singleton implementation is in a .h file, which means it gets compiled into anybody who includes it. This is needed for the Singleton template to work, but we actually only want it compiled into the implementation of the class based on the Singleton, not all of them. If we don't change this, we get link errors when trying to use the Singleton-based class from an outside dll.

  This method just delegates to the template version anyway, but the implementation stays in this single compilation unit, preventing link errors.

References OverlayManager().

## ◆ getTemplateIterator()

TemplateIterator Ogre::v1::OverlayManager::getTemplateIterator | ( |  | ) |
| inline

Returns an iterator over all templates in this manager.

## ◆ getViewportAspectRatio()

Real Ogre::v1::OverlayManager::getViewportAspectRatio | ( |  | ) | const

## ◆ getViewportHeight()

int Ogre::v1::OverlayManager::getViewportHeight | ( |  | ) | const

Gets the height of the destination viewport in pixels.

## ◆ getViewportWidth()

int Ogre::v1::OverlayManager::getViewportWidth | ( |  | ) | const

Gets the width of the destination viewport in pixels.

## ◆ hasOverlayElement()

bool Ogre::v1::OverlayManager::hasOverlayElement | ( | const String & | name,
|  | bool | isTemplate = false )

Tests if an element exists.

References isTemplate().

## ◆ isTemplate()

bool Ogre::v1::OverlayManager::isTemplate | ( | String | strName | ) | const
| inline

Referenced by createOverlayElement(), createOverlayElementFromTemplate(), destroyAllOverlayElements(), destroyOverlayElement(), destroyOverlayElement(), getOverlayElement(), and hasOverlayElement().

## ◆ parseScript()

void Ogre::v1::OverlayManager::parseScript | ( | DataStreamPtr & | stream,
|  | const String & | groupName )
| overridevirtual

Parse a script file.

Parameters

  stream | Weak reference to a data stream which is the source of the script
  groupName | The name of a resource group which should be used if any resources are created during the parse of this script.

Implements Ogre::ScriptLoader.

## Member Data Documentation

## ◆ mDefaultRenderQueueId

uint8 Ogre::v1::OverlayManager::mDefaultRenderQueueId

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

- OgreOverlayManager.h