OGRE
13.6
Object-Oriented Graphics Rendering Engine
|
Manages Overlay objects, parsing them from .overlay files and storing a lookup library of them. More...
#include <OgreOverlayManager.h>
Public Types | |
typedef std::map< String, OverlayElement * > | ElementMap |
typedef std::map< String, OverlayElementFactory * > | FactoryMap |
typedef std::map< String, Overlay * > | OverlayMap |
typedef MapIterator< OverlayMap > | OverlayMapIterator |
Public Member Functions | |
OverlayManager () | |
virtual | ~OverlayManager () |
void | _queueOverlaysForRendering (Camera *cam, RenderQueue *pQueue, Viewport *vp) |
Internal method for queueing the visible overlays for rendering. More... | |
void | _releaseManualHardwareResources () |
Notifies that hardware resources were lost. More... | |
void | _restoreManualHardwareResources () |
Notifies that hardware resources should be restored. More... | |
void | addOverlay (Overlay *overlay) |
void | addOverlayElementFactory (OverlayElementFactory *elemFactory) |
Registers a new OverlayElementFactory with this manager. More... | |
OverlayElement * | cloneOverlayElementFromTemplate (const String &templateName, const String &instanceName) |
Overlay * | create (const String &name) |
Create a new Overlay. More... | |
OverlayElement * | createOverlayElement (const String &typeName, const String &instanceName, bool=false) |
Creates a new OverlayElement of the type requested. More... | |
OverlayElement * | createOverlayElementFromFactory (const String &typeName, const String &instanceName) |
OverlayElement * | createOverlayElementFromTemplate (const String &templateName, const String &typeName, const String &instanceName, bool=false) |
void | destroy (const String &name) |
Destroys an existing overlay by name. More... | |
void | destroy (Overlay *overlay) |
Destroys an existing overlay. More... | |
void | destroyAll (void) |
Destroys all existing overlays. More... | |
void | destroyAllOverlayElements (bool=false) |
Destroys all the OverlayElement created so far. More... | |
void | destroyOverlayElement (const String &instanceName, bool=false) |
Destroys a OverlayElement. More... | |
void | destroyOverlayElement (OverlayElement *pInstance, bool=false) |
Destroys a OverlayElement. More... | |
Overlay * | getByName (const String &name) |
Retrieve an Overlay by name. More... | |
Real | getLoadingOrder (void) const override |
Gets the loading order for scripts of this type. More... | |
OverlayElement * | getOverlayElement (const String &name, bool=false) |
Gets a reference to an existing element. More... | |
const FactoryMap & | getOverlayElementFactoryMap () const |
Get const access to the list of registered OverlayElement factories. More... | |
OverlayMapIterator | getOverlayIterator (void) |
float | getPixelRatio () const |
const StringVector & | getScriptPatterns (void) const override |
Gets the file patterns which should be used to find scripts for this class. More... | |
Real | getViewportAspectRatio (void) const |
int | getViewportHeight (void) const |
Gets the height of the destination viewport in pixels. More... | |
OrientationMode | getViewportOrientationMode (void) const |
Gets the orientation mode of the destination viewport. More... | |
int | getViewportWidth (void) const |
Gets the width of the destination viewport in pixels. More... | |
bool | hasOverlayElement (const String &name, bool=false) |
Tests if an element exists. More... | |
void | parseScript (DataStreamPtr &stream, const String &groupName) override |
Parse a script file. More... | |
void | setPixelRatio (float ratio) |
Sets the pixel ratio: how many viewport pixels represent a single overlay pixel (in one dimension). More... | |
Public Member Functions inherited from Ogre::Singleton< OverlayManager > | |
Singleton (void) | |
~Singleton (void) | |
Public Member Functions inherited from Ogre::ScriptLoader | |
virtual | ~ScriptLoader () |
Static Public Member Functions | |
static OverlayManager & | getSingleton (void) |
Override standard Singleton retrieval. More... | |
static OverlayManager * | getSingletonPtr (void) |
Get the singleton instance. More... | |
Static Public Member Functions inherited from Ogre::Singleton< OverlayManager > | |
static OverlayManager & | getSingleton (void) |
Get the singleton instance. More... | |
static OverlayManager * | getSingletonPtr (void) |
Get the singleton instance. More... | |
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.
typedef std::map<String, Overlay*> Ogre::OverlayManager::OverlayMap |
typedef std::map<String, OverlayElement*> Ogre::OverlayManager::ElementMap |
typedef std::map<String, OverlayElementFactory*> Ogre::OverlayManager::FactoryMap |
Ogre::OverlayManager::OverlayManager | ( | ) |
|
virtual |
void Ogre::OverlayManager::_releaseManualHardwareResources | ( | ) |
Notifies that hardware resources were lost.
void Ogre::OverlayManager::_restoreManualHardwareResources | ( | ) |
Notifies that hardware resources should be restored.
|
overridevirtual |
Gets the file patterns which should be used to find scripts for this class.
This method is called when a resource group is loaded if you use ResourceGroupManager::_registerScriptLoader.
Implements Ogre::ScriptLoader.
|
overridevirtual |
Parse a script file.
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.
|
overridevirtual |
Gets the loading order for scripts of this type.
There are dependencies between some kinds of scripts, and this value enumerates that. Higher values load later during bulk loading tasks.
Implements Ogre::ScriptLoader.
void Ogre::OverlayManager::addOverlay | ( | Overlay * | overlay | ) |
void Ogre::OverlayManager::destroy | ( | const String & | name | ) |
Destroys an existing overlay by name.
void Ogre::OverlayManager::destroy | ( | Overlay * | overlay | ) |
Destroys an existing overlay.
void Ogre::OverlayManager::destroyAll | ( | void | ) |
Destroys all existing overlays.
OverlayMapIterator Ogre::OverlayManager::getOverlayIterator | ( | void | ) |
void Ogre::OverlayManager::_queueOverlaysForRendering | ( | Camera * | cam, |
RenderQueue * | pQueue, | ||
Viewport * | vp | ||
) |
Internal method for queueing the visible overlays for rendering.
int Ogre::OverlayManager::getViewportHeight | ( | void | ) | const |
Gets the height of the destination viewport in pixels.
int Ogre::OverlayManager::getViewportWidth | ( | void | ) | const |
Gets the width of the destination viewport in pixels.
Real Ogre::OverlayManager::getViewportAspectRatio | ( | void | ) | const |
OrientationMode Ogre::OverlayManager::getViewportOrientationMode | ( | void | ) | const |
Gets the orientation mode of the destination viewport.
void Ogre::OverlayManager::setPixelRatio | ( | float | ratio | ) |
Sets the pixel ratio: how many viewport pixels represent a single overlay pixel (in one dimension).
By default this is an 1:1 mapping. However on HiDPI screens you want to increase that to scale up your Overlay.
float Ogre::OverlayManager::getPixelRatio | ( | ) | const |
OverlayElement* Ogre::OverlayManager::createOverlayElement | ( | const String & | typeName, |
const String & | instanceName, | ||
bool | = false |
||
) |
Creates a new OverlayElement of the type requested.
typeName | The type of element to create. |
instanceName | The name to give the new instance. |
OverlayElement* Ogre::OverlayManager::getOverlayElement | ( | const String & | name, |
bool | = false |
||
) |
Gets a reference to an existing element.
bool Ogre::OverlayManager::hasOverlayElement | ( | const String & | name, |
bool | = false |
||
) |
Tests if an element exists.
void Ogre::OverlayManager::destroyOverlayElement | ( | const String & | instanceName, |
bool | = false |
||
) |
Destroys a OverlayElement.
void Ogre::OverlayManager::destroyOverlayElement | ( | OverlayElement * | pInstance, |
bool | = false |
||
) |
Destroys a OverlayElement.
void Ogre::OverlayManager::destroyAllOverlayElements | ( | bool | = false | ) |
Destroys all the OverlayElement created so far.
void Ogre::OverlayManager::addOverlayElementFactory | ( | OverlayElementFactory * | elemFactory | ) |
Registers a new OverlayElementFactory with this manager.
|
inline |
Get const access to the list of registered OverlayElement factories.
OverlayElement* Ogre::OverlayManager::createOverlayElementFromTemplate | ( | const String & | templateName, |
const String & | typeName, | ||
const String & | instanceName, | ||
bool | = false |
||
) |
OverlayElement* Ogre::OverlayManager::cloneOverlayElementFromTemplate | ( | const String & | templateName, |
const String & | instanceName | ||
) |
OverlayElement* Ogre::OverlayManager::createOverlayElementFromFactory | ( | const String & | typeName, |
const String & | instanceName | ||
) |
|
static |
Override standard Singleton retrieval.
|
static |
Get the singleton instance.