Ogre::Root Class Reference
Core » General

The root class of the Ogre system. More...

`#include <OgreRoot.h>`

Inheritance diagram for Ogre::Root:
[legend]

## Public Types

typedef ConstMapIterator< MovableObjectFactoryMap > | MovableObjectFactoryIterator
typedef vector< Plugin * >::type | PluginInstanceList
typedef vector< DynLib * >::type | PluginLibList

## Public Member Functions

| Root (const String &pluginFileName="plugins" OGRE_BUILD_SUFFIX ".cfg", const String &configFileName="ogre.cfg", const String &logFileName="Ogre.log")
| Constructor. More...
| ~Root ()
uint32 | _allocateNextMovableObjectTypeFlag (void)
| Allocate the next MovableObject type flag. More...
bool | _fireFrameEnded (FrameEvent &evt)
| Method for raising frame ended events. More...
bool | _fireFrameEnded ()
| Method for raising frame ended events. More...
bool | _fireFrameRenderingQueued (FrameEvent &evt)
| Method for raising frame rendering queued events. More...
bool | _fireFrameRenderingQueued ()
| Method for raising frame rendering queued events. More...
bool | _fireFrameStarted (FrameEvent &evt)
| Method for raising frame started events. More...
bool | _fireFrameStarted ()
| Method for raising frame started events. More...
SceneManager * | _getCurrentSceneManager (void) const
| Returns the scene manager currently being used to render a frame. More...
void | _popCurrentSceneManager (SceneManager *sm)
| Pops the scene manager currently being used to render. More...
void | _pushCurrentSceneManager (SceneManager *sm)
| Pushes the scene manager currently being used to render. More...
bool | _updateAllRenderTargets (void)
| Internal method used for updating all RenderTarget objects (windows, renderable textures etc) which are set to auto-update. More...
bool | _updateAllRenderTargets (FrameEvent &evt)
| Internal method used for updating all RenderTarget objects (windows, renderable textures etc) which are set to auto-update, with a custom time passed to the frameRenderingQueued events. More...
void | addFrameListener (FrameListener *newListener)
| Registers a FrameListener which will be called back every frame. More...
void | addMovableObjectFactory (MovableObjectFactory *fact, bool overrideExisting=false)
| Register a new MovableObjectFactory which will create new MovableObject instances of a particular type, as identified by the getType() method. More...
void | addRenderSystem (RenderSystem *newRend)
| Adds a new rendering subsystem to the list of available renderers. More...
void | addResourceLocation (const String &name, const String &locType, const String &groupName=ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, bool recursive=false)
| Adds a location to the list of searchable locations for a Resource type. More...
void | addSceneManagerFactory (SceneManagerFactory *fact)
| Register a new SceneManagerFactory, a factory object for creating instances of specific SceneManagers. More...
void | clearEventTimes (void)
| Clears the history of all event times. More...
void | convertColourValue (const ColourValue &colour, uint32 *pDest)
| Generates a packed data version of the passed in ColourValue suitable for use with the current RenderSystem. More...
DataStreamPtr | createFileStream (const String &filename, const String &groupName=ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, bool overwrite=false, const String &locationPattern=StringUtil::BLANK)
| Helper method to assist you in creating writeable file streams. More...
RenderQueueInvocationSequence * | createRenderQueueInvocationSequence (const String &name)
| Create a new RenderQueueInvocationSequence, useful for linking to Viewport instances to perform custom rendering. More...
RenderWindow * | createRenderWindow (const String &name, unsigned int width, unsigned int height, bool fullScreen, const NameValuePairList *miscParams=0)
| Creates a new rendering window. More...
bool | createRenderWindows (const RenderWindowDescriptionList &renderWindowDescriptions, RenderWindowList &createdWindows)
| Creates multiple rendering windows. More...
SceneManager * | createSceneManager (const String &typeName, const String &instanceName=StringUtil::BLANK)
| Create a SceneManager instance of a given type. More...
SceneManager * | createSceneManager (SceneTypeMask typeMask, const String &instanceName=StringUtil::BLANK)
| Create a SceneManager instance based on scene type support. More...
void | destroyAllRenderQueueInvocationSequences (void)
| Destroy all RenderQueueInvocationSequences. More...
void | destroyRenderQueueInvocationSequence (const String &name)
| Destroy a RenderQueueInvocationSequence. More...
void | destroyRenderTarget (RenderTarget *target)
| Destroys the given RenderTarget. More...
void | destroyRenderTarget (const String &name)
| Destroys the given named RenderTarget. More...
void | destroySceneManager (SceneManager *sm)
| Destroy an instance of a SceneManager. More...
RenderTarget * | detachRenderTarget (RenderTarget *pWin)
| Detaches a RenderTarget from the active render system and returns a pointer to it. More...
RenderTarget * | detachRenderTarget (const String &name)
| Detaches a named RenderTarget from the active render system and returns a pointer to it. More...
bool | endRenderingQueued (void)
| Check for planned end of rendering. More...
RenderWindow * | getAutoCreatedWindow (void)
| Retrieves a pointer to the window that was created automatically. More...
const RenderSystemList & | getAvailableRenderers (void)
| Retrieve a list of the available render systems. More...
Real | getDefaultMinPixelSize ()
| Get the default minimum pixel size for object to be rendered by. More...
unsigned int | getDisplayMonitorCount () const
| Gets the number of display monitors. More...
String | getErrorDescription (long errorNumber)
| Utility function for getting a better description of an error code. More...
Real | getFrameSmoothingPeriod (void) const
| Gets the period over which OGRE smooths out fluctuations in frame times. More...
const PluginInstanceList & | getInstalledPlugins () const
| Gets a read-only list of the currently installed plugins. More...
MeshManager * | getMeshManager (void)
| Retrieves a reference to the current MeshManager. More...
MovableObjectFactory * | getMovableObjectFactory (const String &typeName)
| Get a MovableObjectFactory for the given type. More...
MovableObjectFactoryIterator | getMovableObjectFactoryIterator (void) const
| Return an iterator over all the MovableObjectFactory instances currently registered. More...
unsigned long | getNextFrameNumber (void) const
| Gets the number of the next frame to be rendered. More...
bool | getRemoveRenderQueueStructuresOnClear () const
| Get whether the entire render queue structure should be emptied on clearing, or whether just the objects themselves should be cleared. More...
RenderQueueInvocationSequence * | getRenderQueueInvocationSequence (const String &name)
| Get a RenderQueueInvocationSequence. More...
RenderSystem * | getRenderSystem (void)
| Retrieve a pointer to the currently selected render system. More...
RenderSystem * | getRenderSystemByName (const String &name)
| Retrieve a pointer to the render system by the given name. More...
RenderTarget * | getRenderTarget (const String &name)
| Retrieves a pointer to a named render target. More...
SceneManager * | getSceneManager (const String &instanceName) const
| Get an existing SceneManager instance that has already been created, identified by the instance name. More...
SceneManagerEnumerator::SceneManagerIterator | getSceneManagerIterator (void)
| Get an iterator over all the existing SceneManager instances. More...
const SceneManagerMetaData * | getSceneManagerMetaData (const String &typeName) const
| Get more information about a given type of SceneManager. More...
SceneManagerEnumerator::MetaDataIterator | getSceneManagerMetaDataIterator (void) const
| Iterate over all types of SceneManager available for construction, providing some information about each one. More...
TextureManager * | getTextureManager (void)
| Retrieves a reference to the current TextureManager. More...
Timer * | getTimer (void)
| Gets a pointer to the central timer used for all OGRE timings. More...
WorkQueue * | getWorkQueue () const
| Get the WorkQueue for processing background tasks. More...
bool | hasMovableObjectFactory (const String &typeName) const
| Checks whether a factory is registered for a given MovableObject type. More...
bool | hasSceneManager (const String &instanceName) const
| Determines if a given SceneManager already exists. More...
RenderWindow * | initialise (bool autoCreateWindow, const String &windowTitle="OGRE Render Window", const String &customCapabilitiesConfig=StringUtil::BLANK)
| Initialises the renderer. More...
void | installPlugin (Plugin *plugin)
| Install a new plugin. More...
bool | isBlendIndicesGpuRedundant () const
| Returns whether blend indices information needs to be passed to the GPU see setBlendIndicesGpuRedundant() for more information. More...
bool | isBlendWeightsGpuRedundant () const
| Returns whether blend weights information needs to be passed to the GPU see setBlendWeightsGpuRedundant() for more information. More...
bool | isInitialised (void) const
| Returns whether the system is initialised or not. More...
void | loadPlugin (const String &pluginName)
| Manually load a Plugin contained in a DLL / DSO. More...
DataStreamPtr | openFileStream (const String &filename, const String &groupName=ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, const String &locationPattern=StringUtil::BLANK)
| Helper method to assist you in accessing readable file streams. More...
void | operator delete (void *ptr)
void | operator delete (void *ptr, void *)
void | operator delete (void *ptr, const char *, int, const char *)
void | operator delete[] (void *ptr)
void | operator delete[] (void *ptr, const char *, int, const char *)
void * | operator new (size_t sz, const char *file, int line, const char *func)
| operator new, with debug line info More...
void * | operator new (size_t sz)
void * | operator new (size_t sz, void *ptr)
| placement operator new More...
void * | operator new[] (size_t sz, const char *file, int line, const char *func)
| array operator new, with debug line info More...
void * | operator new[] (size_t sz)
void | queueEndRendering (bool state=true)
| Queues the end of rendering. More...
void | removeFrameListener (FrameListener *oldListener)
| Removes a FrameListener from the list of listening classes. More...
void | removeMovableObjectFactory (MovableObjectFactory *fact)
| Removes a previously registered MovableObjectFactory. More...
void | removeResourceLocation (const String &name, const String &groupName=ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME)
| Removes a resource location from the list. More...
void | removeSceneManagerFactory (SceneManagerFactory *fact)
| Unregister a SceneManagerFactory. More...
bool | renderOneFrame (void)
| Render one frame. More...
bool | renderOneFrame (Real timeSinceLastFrame)
| Render one frame, with custom frame time information. More...
bool | restoreConfig (void)
| Checks for saved video/sound/etc settings. More...
void | saveConfig (void)
| Saves the details of the current configuration. More...
void | setBlendIndicesGpuRedundant (bool redundant)
| Sets whether blend indices information needs to be passed to the GPU. More...
void | setBlendWeightsGpuRedundant (bool redundant)
| Sets whether blend weights information needs to be passed to the GPU. More...
void | setDefaultMinPixelSize (Real pixelSize)
| Set the default minimum pixel size for object to be rendered by. More...
void | setFrameSmoothingPeriod (Real period)
| Sets the period over which OGRE smooths out fluctuations in frame times. More...
void | setRemoveRenderQueueStructuresOnClear (bool r)
| Set whether the entire render queue structure should be emptied on clearing, or whether just the objects themselves should be cleared. More...
void | setRenderSystem (RenderSystem *system)
| Sets the rendering subsystem to be used. More...
void | setWorkQueue (WorkQueue *queue)
| Replace the current work queue with an alternative. More...
bool | showConfigDialog (void)
| Displays a dialog asking the user to choose system settings. More...
void | shutdown (void)
| Shuts down the system manually. More...
void | startRendering (void)
| Starts / restarts the automatic rendering cycle. More...
void | uninstallPlugin (Plugin *plugin)
| Uninstall an existing plugin. More...
void | unloadPlugin (const String &pluginName)
| Manually unloads a Plugin contained in a DLL / DSO. More...
void | useCustomRenderSystemCapabilities (RenderSystemCapabilities *capabilities)
| Requests active RenderSystem to use custom RenderSystemCapabilities. More...

## Static Public Member Functions

static Root & | getSingleton (void)
| Override standard Singleton retrieval. More...
static Root * | getSingletonPtr (void)
| Override standard Singleton retrieval. More...

## Protected Types

typedef deque< unsigned long >::type | EventTimesQueue
| Contains the times of recently fired events. More...
enum | FrameEventTimeType { FETT_ANY = 0, FETT_STARTED = 1, FETT_QUEUED = 2, FETT_ENDED = 3, FETT_COUNT = 4 }
| Indicates the type of event to be considered by calculateEventTime(). More...
typedef map< String, MovableObjectFactory * >::type | MovableObjectFactoryMap
typedef map< String, RenderQueueInvocationSequence * >::type | RenderQueueInvocationSequenceMap
typedef deque< SceneManager * >::type | SceneManagerStack

## Protected Member Functions

void | _syncAddedRemovedFrameListeners ()
Real | calculateEventTime (unsigned long now, FrameEventTimeType type)
| Internal method for calculating the average time between recently fired events. More...
void | initialisePlugins ()
| Initialise all loaded plugins - allows plugins to perform actions once the renderer is initialised. More...
void | loadPlugins (const String &pluginsfile="plugins" OGRE_BUILD_SUFFIX ".cfg")
| Method reads a plugins configuration file and instantiates all plugins. More...
void | oneTimePostWindowInit (void)
| Internal method for one-time tasks after first window creation. More...
void | populateFrameEvent (FrameEventTimeType type, FrameEvent &evtToUpdate)
| Update a set of event times (note, progressive, only call once for each type per frame) More...
void | shutdownPlugins ()
| Shuts down all loaded plugins - allows things to be tidied up whilst all plugins are still loaded. More...
void | unloadPlugins ()
| Unloads all loaded plugins. More...

## Protected Attributes

RenderSystem * | mActiveRenderer
set< FrameListener * >::type | mAddedFrameListeners
ArchiveManager * | mArchiveManager
RenderWindow * | mAutoWindow
MovableObjectFactory * | mBillboardChainFactory
MovableObjectFactory * | mBillboardSetFactory
ScriptCompilerManager * | mCompilerManager
CompositorManager * | mCompositorManager
String | mConfigFileName
ControllerManager * | mControllerManager
Real | mDefaultMinPixelSize
DynLibManager * | mDynLibManager
ArchiveFactory * | mEmbeddedZipArchiveFactory
MovableObjectFactory * | mEntityFactory
EventTimesQueue | mEventTimes [FETT_COUNT]
ExternalTextureSourceManager * | mExternalTextureSourceManager
ArchiveFactory * | mFileSystemArchiveFactory
bool | mFirstTimePostWindowInit
| In case multiple render windows are created, only once are the resources loaded. More...
set< FrameListener * >::type | mFrameListeners
| Set of registered frame listeners. More...
Real | mFrameSmoothingTime
HighLevelGpuProgramManager * | mHighLevelGpuProgramManager
bool | mIsBlendIndicesGpuRedundant
| Tells whether blend indices information needs to be passed to the GPU. More...
bool | mIsBlendWeightsGpuRedundant
| Tells whether blend weights information needs to be passed to the GPU. More...
bool | mIsInitialised
| Are we initialised yet? More...
MovableObjectFactory * | mLightFactory
LodStrategyManager * | mLodStrategyManager
LogManager * | mLogManager
MovableObjectFactory * | mManualObjectFactory
MaterialManager * | mMaterialManager
MeshManager * | mMeshManager
MovableObjectFactoryMap | mMovableObjectFactoryMap
unsigned long | mNextFrame
uint32 | mNextMovableObjectTypeFlag
ParticleSystemManager * | mParticleManager
PluginLibList | mPluginLibs
| List of plugin DLLs loaded. More...
PluginInstanceList | mPlugins
| List of Plugin instances registered. More...
PMInjector * | mPMInjector
PMWorker * | mPMWorker
Profiler * | mProfiler
bool | mQueuedEnd
set< FrameListener * >::type | mRemovedFrameListeners
| Set of frame listeners marked for removal and addition. More...
bool | mRemoveQueueStructuresOnClear
RenderSystemList | mRenderers
RenderSystemCapabilitiesManager * | mRenderSystemCapabilitiesManager
ResourceBackgroundQueue * | mResourceBackgroundQueue
ResourceGroupManager * | mResourceGroupManager
MovableObjectFactory * | mRibbonTrailFactory
RenderQueueInvocationSequenceMap | mRQSequenceMap
SceneManagerEnumerator * | mSceneManagerEnum
SceneManagerStack | mSceneManagerStack
ShadowTextureManager * | mShadowTextureManager
SkeletonManager * | mSkeletonManager
Timer * | mTimer
String | mVersion
WorkQueue * | mWorkQueue
ArchiveFactory * | mZipArchiveFactory

## Static Protected Attributes

static Root * | msSingleton

## Friends

class | RenderSystem

## Detailed Description

The root class of the Ogre system.

Remarks
  The Ogre::Root class represents a starting point for the client application. From here, the application can gain access to the fundamentals of the system, namely the rendering systems available, management of saved configurations, logging, and access to other classes in the system. Acts as a hub from which all other objects may be reached. An instance of Root must be created before any other Ogre operations are called. Once an instance has been created, the same instance is accessible throughout the life of that object by using Root::getSingleton (as a reference) or Root::getSingletonPtr (as a pointer).

Definition at line 71 of file OgreRoot.h.

## Member Typedef Documentation

## EventTimesQueue

typedef deque<unsigned long>::type Ogre::Root::EventTimesQueue

protected

Contains the times of recently fired events.

Definition at line 201 of file OgreRoot.h.

## MovableObjectFactoryIterator

typedef ConstMapIterator<MovableObjectFactoryMap> Ogre::Root::MovableObjectFactoryIterator

Definition at line 1025 of file OgreRoot.h.

## MovableObjectFactoryMap

typedef map<String, MovableObjectFactory*>::type Ogre::Root::MovableObjectFactoryMap

protected

Definition at line 135 of file OgreRoot.h.

## PluginInstanceList

typedef vector<Plugin*>::type Ogre::Root::PluginInstanceList

Definition at line 128 of file OgreRoot.h.

## PluginLibList

typedef vector<DynLib*>::type Ogre::Root::PluginLibList

Definition at line 127 of file OgreRoot.h.

## RenderQueueInvocationSequenceMap

typedef map<String, RenderQueueInvocationSequence*>::type Ogre::Root::RenderQueueInvocationSequenceMap

protected

Definition at line 146 of file OgreRoot.h.

## SceneManagerStack

typedef deque<SceneManager*>::type Ogre::Root::SceneManagerStack

protected

Definition at line 89 of file OgreRoot.h.

## Member Enumeration Documentation

## FrameEventTimeType

enum Ogre::Root::FrameEventTimeType

protected

Indicates the type of event to be considered by calculateEventTime().

Enumerator
FETT_ANY |
FETT_STARTED |
FETT_QUEUED |
FETT_ENDED |
FETT_COUNT |

Definition at line 192 of file OgreRoot.h.

## Constructor & Destructor Documentation

## Root()

Ogre::Root::Root | ( | const String & | pluginFileName = `"plugins" OGRE_BUILD_SUFFIX ".cfg"`,
|  | const String & | configFileName = `"ogre.cfg"`,
|  | const String & | logFileName = `"Ogre.log"`
| ) |  |

Constructor.

Parameters

  pluginFileName | The file that contains plugins information. Defaults to "plugins.cfg" in release build and to "plugins_d.cfg" in debug build. May be left blank to ignore.
  configFileName | The file that contains the configuration to be loaded. Defaults to "ogre.cfg", may be left blank to load nothing.
  logFileName | The logfile to create, defaults to Ogre.log, may be left blank if you've already set up LogManager & Log yourself

## ~Root()

Ogre::Root::~Root | ( |  | ) |

## Member Function Documentation

## _allocateNextMovableObjectTypeFlag()

uint32 Ogre::Root::_allocateNextMovableObjectTypeFlag | ( | void |  | ) |

Allocate the next MovableObject type flag.

Remarks
  This is done automatically if MovableObjectFactory::requestTypeFlags returns true; don't call this manually unless you're sure you need to.

## _fireFrameEnded() [1/2]

bool Ogre::Root::_fireFrameEnded | ( | FrameEvent & | evt | ) |

Method for raising frame ended events.

Remarks
  This method is only for internal use when you use OGRE's inbuilt rendering loop (Root::startRendering). However, if you run your own rendering loop then you should call this method to ensure that FrameListener objects are notified of frame events; processes like texture animation and particle systems rely on this.

Note
  This method takes an event object as a parameter, so you can specify the times yourself. If you are happy for OGRE to automatically calculate the frame time for you, then call the other version of this method with no parameters.

Parameters

  evt | Event object which includes all the timing information which you have calculated for yourself

Returns
  False if one or more frame listeners elected that the rendering loop should be terminated, true otherwise.

## _fireFrameEnded() [2/2]

bool Ogre::Root::_fireFrameEnded | ( |  | ) |

Method for raising frame ended events.

Remarks
  This method is only for internal use when you use OGRE's inbuilt rendering loop (Root::startRendering). However, if you run your own rendering loop then you should call this method to ensure that FrameListener objects are notified of frame events; processes like texture animation and particle systems rely on this.

Note
  This method calculates the frame timing information for you based on the elapsed time. If you want to specify elapsed times yourself you should call the other version of this method which takes event details as a parameter.

Returns
  False if one or more frame listeners elected that the rendering loop should be terminated, true otherwise.

## _fireFrameRenderingQueued() [1/2]

bool Ogre::Root::_fireFrameRenderingQueued | ( | FrameEvent & | evt | ) |

Method for raising frame rendering queued events.

Remarks
  This method is only for internal use when you use OGRE's inbuilt rendering loop (Root::startRendering). However, if you run your own rendering loop then you should call this method too, to ensure that all state is updated correctly. You should call it after the windows have been updated but before the buffers are swapped, or if you are not separating the update and buffer swap, then after the update just before _fireFrameEnded.

## _fireFrameRenderingQueued() [2/2]

bool Ogre::Root::_fireFrameRenderingQueued | ( |  | ) |

Method for raising frame rendering queued events.

Remarks
  This method is only for internal use when you use OGRE's inbuilt rendering loop (Root::startRendering). However, if you run your own rendering loop then you you may want to call this method too, although nothing in OGRE relies on this particular event. Really if you're running your own rendering loop at this level of detail then you can get the same effect as doing your updates in a frameRenderingQueued callback by just calling RenderWindow::update with the 'swapBuffers' option set to false.

## _fireFrameStarted() [1/2]

bool Ogre::Root::_fireFrameStarted | ( | FrameEvent & | evt | ) |

Method for raising frame started events.

Remarks
  This method is only for internal use when you use OGRE's inbuilt rendering loop (Root::startRendering). However, if you run your own rendering loop then you should call this method to ensure that FrameListener objects are notified of frame events; processes like texture animation and particle systems rely on this.

  Calling this method also increments the frame number, which is important for keeping some elements of the engine up to date.

Note
  This method takes an event object as a parameter, so you can specify the times yourself. If you are happy for OGRE to automatically calculate the frame time for you, then call the other version of this method with no parameters.

Parameters

  evt | Event object which includes all the timing information which you have calculated for yourself

Returns
  False if one or more frame listeners elected that the rendering loop should be terminated, true otherwise.

## _fireFrameStarted() [2/2]

bool Ogre::Root::_fireFrameStarted | ( |  | ) |

Method for raising frame started events.

Remarks
  This method is only for internal use when you use OGRE's inbuilt rendering loop (Root::startRendering). However, if you run your own rendering loop then you should call this method to ensure that FrameListener objects are notified of frame events; processes like texture animation and particle systems rely on this.

  Calling this method also increments the frame number, which is important for keeping some elements of the engine up to date.

Note
  This method calculates the frame timing information for you based on the elapsed time. If you want to specify elapsed times yourself you should call the other version of this method which takes event details as a parameter.

Returns
  False if one or more frame listeners elected that the rendering loop should be terminated, true otherwise.

## _getCurrentSceneManager()

SceneManager* Ogre::Root::_getCurrentSceneManager | ( | void |  | ) | const

Returns the scene manager currently being used to render a frame.

Remarks
  This is only intended for internal use; it is only valid during the rendering of a frame.

## _popCurrentSceneManager()

void Ogre::Root::_popCurrentSceneManager | ( | SceneManager * | sm | ) |

Pops the scene manager currently being used to render.

Remarks
  This is only intended for internal use.

## _pushCurrentSceneManager()

void Ogre::Root::_pushCurrentSceneManager | ( | SceneManager * | sm | ) |

Pushes the scene manager currently being used to render.

Remarks
  This is only intended for internal use.

## _syncAddedRemovedFrameListeners()

void Ogre::Root::_syncAddedRemovedFrameListeners | ( |  | ) |

protected

## _updateAllRenderTargets() [1/2]

bool Ogre::Root::_updateAllRenderTargets | ( | void |  | ) |

Internal method used for updating all RenderTarget objects (windows, renderable textures etc) which are set to auto-update.

Remarks
  You don't need to use this method if you're using Ogre's own internal rendering loop (Root::startRendering). If you're running your own loop you may wish to call it to update all the render targets which are set to auto update (RenderTarget::setAutoUpdated). You can also update individual RenderTarget instances using their own update() method.

Returns
  false if a FrameListener indicated it wishes to exit the render loop

## _updateAllRenderTargets() [2/2]

bool Ogre::Root::_updateAllRenderTargets | ( | FrameEvent & | evt | ) |

Internal method used for updating all RenderTarget objects (windows, renderable textures etc) which are set to auto-update, with a custom time passed to the frameRenderingQueued events.

Remarks
  You don't need to use this method if you're using Ogre's own internal rendering loop (Root::startRendering). If you're running your own loop you may wish to call it to update all the render targets which are set to auto update (RenderTarget::setAutoUpdated). You can also update individual RenderTarget instances using their own update() method.

Returns
  false if a FrameListener indicated it wishes to exit the render loop

## addFrameListener()

void Ogre::Root::addFrameListener | ( | FrameListener * | newListener | ) |

Registers a FrameListener which will be called back every frame.

Remarks
  A FrameListener is a class which implements methods which will be called every frame.

  See the FrameListener class for more details on the specifics It is imperitive that the instance passed to this method is not destroyed before either the rendering loop ends, or the class is removed from the listening list using removeFrameListener.

Note
  This method can only be called after Root::initialise has been called.

See also
  FrameListener, Root::removeFrameListener

## addMovableObjectFactory()

void Ogre::Root::addMovableObjectFactory | ( | MovableObjectFactory * | fact,
|  | bool | overrideExisting = `false`
| ) |  |

Register a new MovableObjectFactory which will create new MovableObject instances of a particular type, as identified by the getType() method.

Remarks
  Plugin creators can create subclasses of MovableObjectFactory which construct custom subclasses of MovableObject for insertion in the scene. This is the primary way that plugins can make custom objects available.

Parameters

  fact | Pointer to the factory instance
  overrideExisting | Set this to true to override any existing factories which are registered for the same type. You should only change this if you are very sure you know what you're doing.

## addRenderSystem()

void Ogre::Root::addRenderSystem | ( | RenderSystem * | newRend | ) |

Adds a new rendering subsystem to the list of available renderers.

Remarks
  Intended for use by advanced users and plugin writers only! Calling this method with a pointer to a valid RenderSystem (subclass) adds a rendering API implementation to the list of available ones. Typical examples would be an OpenGL implementation and a Direct3D implementation.

Note
  This should usually be called from the dllStartPlugin() function of an extension plug-in.

## addResourceLocation()

void Ogre::Root::addResourceLocation | ( | const String & | name,
|  | const String & | locType,
|  | const String & | groupName = `ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME`,
|  | bool | recursive = `false`
| ) |  |

Adds a location to the list of searchable locations for a Resource type.

Remarks
  Resource files (textures, models etc) need to be loaded from specific locations. By calling this method, you add another search location to the list. Locations added first are preferred over locations added later.

  Locations can be folders, compressed archives, even perhaps remote locations. Facilities for loading from different locations are provided by plugins which provide implementations of the Archive class. All the application user has to do is specify a 'loctype' string in order to indicate the type of location, which should map onto one of the provided plugins. Ogre comes configured with the 'FileSystem' (folders) and 'Zip' (archive compressed with the pkzip / WinZip etc utilities) types.

  You can also supply the name of a resource group which should have this location applied to it. The ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME group is the default, and one resource group which will always exist. You should consider defining resource groups for your more specific resources (e.g. per level) so that you can control loading / unloading better.

Parameters

  name | The name of the location, e.g. './data' or '/compressed/gamedata.zip'
  locType | A string identifying the location type, e.g. 'FileSystem' (for folders), 'Zip' etc. Must map to a registered plugin which deals with this type (FileSystem and Zip should always be available)
  groupName | Type of name of the resource group which this location should apply to; defaults to the General group which applies to all non-specific resources.
  recursive | If the resource location has a concept of recursive directory traversal, enabling this option will mean you can load resources in subdirectories using only their unqualified name. The default is to disable this so that resources in subdirectories with the same name are still unique.

See also
  Archive

## addSceneManagerFactory()

void Ogre::Root::addSceneManagerFactory | ( | SceneManagerFactory * | fact | ) |

Register a new SceneManagerFactory, a factory object for creating instances of specific SceneManagers.

Remarks
  Plugins should call this to register as new SceneManager providers.

## calculateEventTime()

Real Ogre::Root::calculateEventTime | ( | unsigned long | now,
|  | FrameEventTimeType | type
| ) |  |

protected

Internal method for calculating the average time between recently fired events.

Parameters

  now | The current time in ms.
  type | The type of event to be considered.

## clearEventTimes()

void Ogre::Root::clearEventTimes | ( | void |  | ) |

Clears the history of all event times.

Remarks
  OGRE stores a history of the last few event times in order to smooth out any inaccuracies and temporary fluctuations. However, if you pause or don't render for a little while this can cause a lurch, so if you're resuming rendering after a break, call this method to reset the stored times

## convertColourValue()

void Ogre::Root::convertColourValue | ( | const ColourValue & | colour,
|  | uint32 * | pDest
| ) |  |

Generates a packed data version of the passed in ColourValue suitable for use with the current RenderSystem.

Remarks
  Since different render systems have different colour data formats (eg RGBA for GL, ARGB for D3D) this method allows you to use 1 method for all.

Parameters

  colour | The colour to convert
  pDest | Pointer to location to put the result.

## createFileStream()

DataStreamPtr Ogre::Root::createFileStream | ( | const String & | filename,
|  | const String & | groupName = `ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME`,
|  | bool | overwrite = `false`,
|  | const String & | locationPattern = `StringUtil::BLANK`
| ) |  |

Helper method to assist you in creating writeable file streams.

Remarks
  This is a high-level utility method which you can use to find a place to save a file more easily. If the filename you specify is either an absolute or relative filename (ie it includes path separators), then the file will be created in the normal filesystem using that specification. If it doesn't, then the method will look for a writeable resource location via ResourceGroupManager::createResource using the other params provided.

Parameters

  filename | The name of the file to create. If it includes path separators, the filesystem will be accessed direct. If no path separators are present the resource system is used, falling back on the raw filesystem after.
  groupName | The name of the group in which to create the file, if the resource system is used
  overwrite | If true, an existing file will be overwritten, if false an error will occur if the file already exists
  locationPattern | If the resource group contains multiple locations, then usually the file will be created in the first writable location. If you want to be more specific, you can include a location pattern here and only locations which match that pattern (as determined by StringUtil::match) will be considered candidates for creation.

## createRenderQueueInvocationSequence()

RenderQueueInvocationSequence* Ogre::Root::createRenderQueueInvocationSequence | ( | const String & | name | ) |

Create a new RenderQueueInvocationSequence, useful for linking to Viewport instances to perform custom rendering.

Parameters

  name | The name to give the new sequence

## createRenderWindow()

RenderWindow* Ogre::Root::createRenderWindow | ( | const String & | name,
|  | unsigned int | width,
|  | unsigned int | height,
|  | bool | fullScreen,
|  | const NameValuePairList * | miscParams = `0`
| ) |  |

Creates a new rendering window.

Remarks
  This method creates a new rendering window as specified by the paramteters. The rendering system could be responible for only a single window (e.g. in the case of a game), or could be in charge of multiple ones (in the case of a level editor). The option to create the window as a child of another is therefore given. This method will create an appropriate subclass of RenderWindow depending on the API and platform implementation.

  After creation, this window can be retrieved using getRenderTarget().

Parameters

  name | The name of the window. Used in other methods later like setRenderTarget and getRenderTarget.
  width | The width of the new window.
  height | The height of the new window.
  fullScreen | Specify true to make the window full screen without borders, title bar or menu bar.

  miscParams

  A NameValuePairList describing the other parameters for the new rendering window. Options are case sensitive. Unrecognised parameters will be ignored silently. These values might be platform dependent, but these are present for all platforms unless indicated otherwise:

  Key | Type/Values | Default | Description | Notes
  title | Any string | RenderTarget name | The title of the window that will appear in the title bar |
  colourDepth | 16, 32 | Desktop depth | Colour depth of the resulting rendering window; only applies if fullScreen | Win32 Specific
  left | Positive integers | Centred | Screen x coordinate from left |
  top | Positive integers | Centred | Screen y coordinate from left |
  depthBuffer | true, false | true | Use depth buffer | DirectX9 specific
  externalWindowHandle | Win32: HWND as integer GLX: poslong:posint:poslong (display*:screen:windowHandle) or poslong:posint:poslong:poslong (display*:screen:windowHandle:XVisualInfo*) OS X: WindowRef for Carbon or NSWindow for Cocoa address as an integer iOS: UIWindow address as an integer | 0 (none) | External window handle, for embedding the OGRE render in an existing window |

  externalGLControl

  true, false

  false

  Let the external window control OpenGL i.e. don't select a pixel format for the window, do not change v-sync and do not swap buffer. When set to true, the calling application is responsible of OpenGL initialization and buffer swapping. It should also create an OpenGL context for its own rendering, Ogre will create one for its use. Then the calling application must also enable Ogre OpenGL context before calling any Ogre function and restore its OpenGL context after these calls.

  OpenGL specific

  externalGLContext | Context as Unsigned Long | 0 (create own context) | Use an externally created GL context | OpenGL Specific
  parentWindowHandle | Win32: HWND as integer GLX: poslong:posint:poslong (display*:screen:windowHandle) or poslong:posint:poslong:poslong (display*:screen:windowHandle:XVisualInfo*) | 0 (none) | Parent window handle, for embedding the OGRE in a child of an external window |
  macAPI | String: "cocoa" or "carbon" | "carbon" | Specifies the type of rendering window on the Mac Platform. | Mac OS X Specific |

  macAPICocoaUseNSView

  bool "true" or "false"

  "false"

  On the Mac platform the most diffused method to embed OGRE in a custom application is to use Interface Builder and add to the interface an instance of OgreView. The pointer to this instance is then used as "externalWindowHandle". However, there are cases where you are NOT using Interface Builder and you get the Cocoa NSView* of an existing interface. For example, this is happens when you want to render into a Java/AWT interface. In short, by setting this flag to "true" the Ogre::Root::createRenderWindow interprets the "externalWindowHandle" as a NSView* instead of an OgreView*. See OgreOSXCocoaView.h/mm.

  Mac OS X Specific

  contentScalingFactor

  Positive Float greater than 1.0

  The default content scaling factor of the screen

  Specifies the CAEAGLLayer content scaling factor. Only supported on iOS 4 or greater. This can be useful to limit the resolution of the OpenGL ES backing store. For example, the iPhone 4's native resolution is 960 x 640. Windows are always 320 x 480, if you would like to limit the display to 720 x 480, specify 1.5 as the scaling factor.

  iOS Specific

  externalViewHandle | UIView pointer as an integer | 0 | External view handle, for rendering OGRE render in an existing view | iOS Specific |
  externalViewControllerHandle | UIViewController pointer as an integer | 0 | External view controller handle, for embedding OGRE in an existing view controller | iOS Specific |
  externalSharegroup | EAGLSharegroup pointer as an integer | 0 | External sharegroup, used to shared GL resources between contexts | iOS Specific |
  Full Screen | true, false | false | Specify whether to create the window in full screen mode | OS X Specific |
  FSAA | Positive integer (usually 0, 2, 4, 8, 16) | 0 | Full screen antialiasing factor |
  FSAAHint | Depends on RenderSystem and hardware. Currently supports: "Quality": on systems that have an option to prefer higher AA quality over speed, use it | Blank | Full screen antialiasing hint |
  displayFrequency | Refresh rate in Hertz (e.g. 60, 75, 100) | Desktop vsync rate | Display frequency rate, for fullscreen mode |
  vsync | true, false | false | Synchronize buffer swaps to monitor vsync, eliminating tearing at the expense of a fixed frame rate |
  vsyncInterval | 1, 2, 3, 4 | 1 | If vsync is enabled, the minimum number of vertical blanks that should occur between renders. For example if vsync is enabled, the refresh rate is 60 and this is set to 2, then the frame rate will be locked at 30. |
  border | none, fixed, resize | resize | The type of window border (in windowed mode) |
  outerDimensions | true, false | false | Whether the width/height is expressed as the size of the outer window, rather than the content area |
  useNVPerfHUD | true, false | false | Enable the use of nVidia NVPerfHUD |
  gamma | true, false | false | Enable hardware conversion from linear colour space to gamma colour space on rendering to the window. |
  enableDoubleClick | true, false | false | Enable the window to keep track and transmit double click messages. | Win32 Specific

## createRenderWindows()

bool Ogre::Root::createRenderWindows | ( | const RenderWindowDescriptionList & | renderWindowDescriptions,
|  | RenderWindowList & | createdWindows
| ) |  |

Creates multiple rendering windows.

Parameters

  renderWindowDescriptions | Array of structures containing the descriptions of each render window. The structure's members are the same as the parameters of _createRenderWindow: name width height fullScreen miscParams See _createRenderWindow for details about each member.
  createdWindows | This array will hold the created render windows.

Returns
  true on success.

## createSceneManager() [1/2]

SceneManager* Ogre::Root::createSceneManager | ( | const String & | typeName,
|  | const String & | instanceName = `StringUtil::BLANK`
| ) |  |

Create a SceneManager instance of a given type.

Remarks
  You can use this method to create a SceneManager instance of a given specific type. You may know this type already, or you may have discovered it by looking at the results from getMetaDataIterator.

Note
  This method throws an exception if the named type is not found.

Parameters

  typeName | String identifying a unique SceneManager type
  instanceName | Optional name to given the new instance that is created. If you leave this blank, an auto name will be assigned.

## createSceneManager() [2/2]

SceneManager* Ogre::Root::createSceneManager | ( | SceneTypeMask | typeMask,
|  | const String & | instanceName = `StringUtil::BLANK`
| ) |  |

Create a SceneManager instance based on scene type support.

Remarks
  Creates an instance of a SceneManager which supports the scene types identified in the parameter. If more than one type of SceneManager has been registered as handling that combination of scene types, in instance of the last one registered is returned.

Note
  This method always succeeds, if a specific scene manager is not found, the default implementation is always returned.

Parameters

  typeMask | A mask containing one or more SceneType flags
  instanceName | Optional name to given the new instance that is created. If you leave this blank, an auto name will be assigned.

## destroyAllRenderQueueInvocationSequences()

void Ogre::Root::destroyAllRenderQueueInvocationSequences | ( | void |  | ) |

Destroy all RenderQueueInvocationSequences.

Remarks
  You must ensure that no Viewports are using custom sequences.

## destroyRenderQueueInvocationSequence()

void Ogre::Root::destroyRenderQueueInvocationSequence | ( | const String & | name | ) |

Destroy a RenderQueueInvocationSequence.

Remarks
  You must ensure that no Viewports are using this sequence.

Parameters

  name | The name to identify the sequence

## destroyRenderTarget() [1/2]

void Ogre::Root::destroyRenderTarget | ( | RenderTarget * | target | ) |

Destroys the given RenderTarget.

## destroyRenderTarget() [2/2]

void Ogre::Root::destroyRenderTarget | ( | const String & | name | ) |

Destroys the given named RenderTarget.

## destroySceneManager()

void Ogre::Root::destroySceneManager | ( | SceneManager * | sm | ) |

Destroy an instance of a SceneManager.

## detachRenderTarget() [1/2]

RenderTarget* Ogre::Root::detachRenderTarget | ( | RenderTarget * | pWin | ) |

Detaches a RenderTarget from the active render system and returns a pointer to it.

Note
  If the render target cannot be found, NULL is returned.

## detachRenderTarget() [2/2]

RenderTarget* Ogre::Root::detachRenderTarget | ( | const String & | name | ) |

Detaches a named RenderTarget from the active render system and returns a pointer to it.

Note
  If the render target cannot be found, NULL is returned.

## endRenderingQueued()

bool Ogre::Root::endRenderingQueued | ( | void |  | ) |

Check for planned end of rendering.

Remarks
  This method return true if queueEndRendering() was called before.

See also
  Root, Root::queueEndRendering, Root::startRendering

## getAutoCreatedWindow()

RenderWindow* Ogre::Root::getAutoCreatedWindow | ( | void |  | ) |

Retrieves a pointer to the window that was created automatically.

Remarks
  When Root is initialised an optional window is created. This method retrieves a pointer to that window.

Note
  returns a null pointer when Root has not been initialised with the option of creating a window.

## getAvailableRenderers()

const RenderSystemList& Ogre::Root::getAvailableRenderers | ( | void |  | ) |

Retrieve a list of the available render systems.

Remarks
  Retrieves a pointer to the list of available renderers as a list of RenderSystem subclasses. Can be used to build a custom settings dialog.

## getDefaultMinPixelSize()

Real Ogre::Root::getDefaultMinPixelSize | ( |  | ) |

Get the default minimum pixel size for object to be rendered by.

Definition at line 1086 of file OgreRoot.h.

## getDisplayMonitorCount()

unsigned int Ogre::Root::getDisplayMonitorCount | ( |  | ) | const

Gets the number of display monitors.

## getErrorDescription()

String Ogre::Root::getErrorDescription | ( | long | errorNumber | ) |

Utility function for getting a better description of an error code.

## getFrameSmoothingPeriod()

Real Ogre::Root::getFrameSmoothingPeriod | ( | void |  | ) | const

Gets the period over which OGRE smooths out fluctuations in frame times.

Definition at line 990 of file OgreRoot.h.

## getInstalledPlugins()

const PluginInstanceList& Ogre::Root::getInstalledPlugins | ( |  | ) | const

Gets a read-only list of the currently installed plugins.

Definition at line 756 of file OgreRoot.h.

## getMeshManager()

MeshManager* Ogre::Root::getMeshManager | ( | void |  | ) |

Retrieves a reference to the current MeshManager.

Remarks
  This performs the same function as MeshManager::getSingleton and is provided for convenience to scripting engines.

## getMovableObjectFactory()

MovableObjectFactory* Ogre::Root::getMovableObjectFactory | ( | const String & | typeName | ) |

Get a MovableObjectFactory for the given type.

## getMovableObjectFactoryIterator()

MovableObjectFactoryIterator Ogre::Root::getMovableObjectFactoryIterator | ( | void |  | ) | const

Return an iterator over all the MovableObjectFactory instances currently registered.

## getNextFrameNumber()

unsigned long Ogre::Root::getNextFrameNumber | ( | void |  | ) | const

Gets the number of the next frame to be rendered.

Remarks
  Note that this is 'next frame' rather than 'current frame' because it indicates the frame number that current changes made to the scene will take effect. It is incremented after all rendering commands for the current frame have been queued, thus reflecting that if you start performing changes then, you will actually see them in the next frame.

Definition at line 862 of file OgreRoot.h.

## getRemoveRenderQueueStructuresOnClear()

bool Ogre::Root::getRemoveRenderQueueStructuresOnClear | ( |  | ) | const

Get whether the entire render queue structure should be emptied on clearing, or whether just the objects themselves should be cleared.

Definition at line 351 of file OgreRoot.h.

## getRenderQueueInvocationSequence()

RenderQueueInvocationSequence* Ogre::Root::getRenderQueueInvocationSequence | ( | const String & | name | ) |

Get a RenderQueueInvocationSequence.

Parameters

  name | The name to identify the sequence

## getRenderSystem()

RenderSystem* Ogre::Root::getRenderSystem | ( | void |  | ) |

Retrieve a pointer to the currently selected render system.

## getRenderSystemByName()

RenderSystem* Ogre::Root::getRenderSystemByName | ( | const String & | name | ) |

Retrieve a pointer to the render system by the given name.

Parameters

  name | Name of the render system intend to retrieve.

Returns
  A pointer to the render system, NULL if no found.

## getRenderTarget()

RenderTarget* Ogre::Root::getRenderTarget | ( | const String & | name | ) |

Retrieves a pointer to a named render target.

## getSceneManager()

SceneManager* Ogre::Root::getSceneManager | ( | const String & | instanceName | ) | const

Get an existing SceneManager instance that has already been created, identified by the instance name.

Parameters

  instanceName | The name of the instance to retrieve.

## getSceneManagerIterator()

SceneManagerEnumerator::SceneManagerIterator Ogre::Root::getSceneManagerIterator | ( | void |  | ) |

Get an iterator over all the existing SceneManager instances.

## getSceneManagerMetaData()

const SceneManagerMetaData* Ogre::Root::getSceneManagerMetaData | ( | const String & | typeName | ) | const

Get more information about a given type of SceneManager.

Remarks
  The metadata returned tells you a few things about a given type of SceneManager, which can be created using a factory that has been registered already.

Parameters

  typeName | The type name of the SceneManager you want to enquire on. If you don't know the typeName already, you can iterate over the metadata for all types using getMetaDataIterator.

## getSceneManagerMetaDataIterator()

SceneManagerEnumerator::MetaDataIterator Ogre::Root::getSceneManagerMetaDataIterator | ( | void |  | ) | const

Iterate over all types of SceneManager available for construction, providing some information about each one.

## getSingleton()

static Root& Ogre::Root::getSingleton | ( | void |  | ) |

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.

## getSingletonPtr()

static Root* Ogre::Root::getSingletonPtr | ( | void |  | ) |

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.

## getTextureManager()

TextureManager* Ogre::Root::getTextureManager | ( | void |  | ) |

Retrieves a reference to the current TextureManager.

Remarks
  This performs the same function as TextureManager::getSingleton, but is provided for convenience particularly to scripting engines.

  Note that a TextureManager will NOT be available until the Ogre system has been initialised by selecting a RenderSystem, calling Root::initialise and a window having been created (this may have been done by initialise if required). This is because the exact runtime subclass which will be implementing the calls will differ depending on the rendering engine selected, and these typically require a window upon which to base texture format decisions.

## getTimer()

Timer* Ogre::Root::getTimer | ( | void |  | ) |

Gets a pointer to the central timer used for all OGRE timings.

## getWorkQueue()

WorkQueue* Ogre::Root::getWorkQueue | ( |  | ) | const

Get the WorkQueue for processing background tasks.

You are free to add new requests and handlers to this queue to process your custom background tasks using the shared thread pool. However, you must remember to assign yourself a new channel through which to process your tasks.

Definition at line 1042 of file OgreRoot.h.

## hasMovableObjectFactory()

bool Ogre::Root::hasMovableObjectFactory | ( | const String & | typeName | ) | const

Checks whether a factory is registered for a given MovableObject type.

## hasSceneManager()

bool Ogre::Root::hasSceneManager | ( | const String & | instanceName | ) | const

Determines if a given SceneManager already exists.

Parameters

  instanceName | The name of the instance to retrieve.

## initialise()

RenderWindow* Ogre::Root::initialise | ( | bool | autoCreateWindow,
|  | const String & | windowTitle = `"OGRE Render Window"`,
|  | const String & | customCapabilitiesConfig = `StringUtil::BLANK`
| ) |  |

Initialises the renderer.

Remarks
  This method can only be called after a renderer has been selected with Root::setRenderSystem, and it will initialise the selected rendering system ready for use.

Parameters

  autoCreateWindow | If true, a rendering window will automatically be created (saving a call to Root::createRenderWindow). The window will be created based on the options currently set on the render system.

Returns
  A pointer to the automatically created window, if requested, otherwise NULL.

## initialisePlugins()

void Ogre::Root::initialisePlugins | ( |  | ) |

protected

Initialise all loaded plugins - allows plugins to perform actions once the renderer is initialised.

## installPlugin()

void Ogre::Root::installPlugin | ( | Plugin * | plugin | ) |

Install a new plugin.

Remarks
  This installs a new extension to OGRE. The plugin itself may be loaded from a DLL / DSO, or it might be statically linked into your own application. Either way, something has to call this method to get it registered and functioning. You should only call this method directly if your plugin is not in a DLL that could otherwise be loaded with loadPlugin, since the DLL function dllStartPlugin should call this method when the DLL is loaded.

## isBlendIndicesGpuRedundant()

bool Ogre::Root::isBlendIndicesGpuRedundant | ( |  | ) | const

Returns whether blend indices information needs to be passed to the GPU see setBlendIndicesGpuRedundant() for more information.

Definition at line 1064 of file OgreRoot.h.

## isBlendWeightsGpuRedundant()

bool Ogre::Root::isBlendWeightsGpuRedundant | ( |  | ) | const

Returns whether blend weights information needs to be passed to the GPU see setBlendWeightsGpuRedundant() for more information.

Definition at line 1076 of file OgreRoot.h.

## isInitialised()

bool Ogre::Root::isInitialised | ( | void |  | ) | const

Returns whether the system is initialised or not.

Definition at line 339 of file OgreRoot.h.

## loadPlugin()

void Ogre::Root::loadPlugin | ( | const String & | pluginName | ) |

Manually load a Plugin contained in a DLL / DSO.

Remarks
  Plugins embedded in DLLs can be loaded at startup using the plugin configuration file specified when you create Root. This method allows you to load plugin DLLs directly in code. The DLL in question is expected to implement a dllStartPlugin method which instantiates a Plugin subclass and calls Root::installPlugin. It should also implement dllStopPlugin (see Root::unloadPlugin)

Parameters

  pluginName | Name of the plugin library to load

## loadPlugins()

void Ogre::Root::loadPlugins | ( | const String & | pluginsfile = `"plugins" OGRE_BUILD_SUFFIX ".cfg"` | ) |

protected

Method reads a plugins configuration file and instantiates all plugins.

Parameters

  pluginsfile | The file that contains plugins information. Defaults to "plugins.cfg" in release and to "plugins_d.cfg" in debug build.

## oneTimePostWindowInit()

void Ogre::Root::oneTimePostWindowInit | ( | void |  | ) |

protected

Internal method for one-time tasks after first window creation.

## openFileStream()

DataStreamPtr Ogre::Root::openFileStream | ( | const String & | filename,
|  | const String & | groupName = `ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME`,
|  | const String & | locationPattern = `StringUtil::BLANK`
| ) |  |

Helper method to assist you in accessing readable file streams.

Remarks
  This is a high-level utility method which you can use to find a place to open a file more easily. It checks the resource system first, and if that fails falls back on accessing the file system directly.

Parameters

  filename | The name of the file to open.
  groupName | The name of the group in which to create the file, if the resource system is used
  locationPattern | If the resource group contains multiple locations, then usually the file will be created in the first writable location. If you want to be more specific, you can include a location pattern here and only locations which match that pattern (as determined by StringUtil::match) will be considered candidates for creation.

## operator delete() [1/3]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr | ) |

inherited

Definition at line 96 of file OgreMemoryAllocatedObject.h.

## operator delete() [2/3]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr,
|  | void * |
| ) |  |

inherited

Definition at line 102 of file OgreMemoryAllocatedObject.h.

## operator delete() [3/3]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr,
|  | const char * | ,
|  | int | ,
|  | const char * |
| ) |  |

inherited

Definition at line 108 of file OgreMemoryAllocatedObject.h.

## operator delete[]() [1/2]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr | ) |

inherited

Definition at line 113 of file OgreMemoryAllocatedObject.h.

## operator delete[]() [2/2]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr,
|  | const char * | ,
|  | int | ,
|  | const char * |
| ) |  |

inherited

Definition at line 119 of file OgreMemoryAllocatedObject.h.

## operator new() [1/3]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz,
|  | const char * | file,
|  | int | line,
|  | const char * | func
| ) |  |

inherited

operator new, with debug line info

Definition at line 68 of file OgreMemoryAllocatedObject.h.

## operator new() [2/3]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz | ) |

inherited

Definition at line 73 of file OgreMemoryAllocatedObject.h.

## operator new() [3/3]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz,
|  | void * | ptr
| ) |  |

inherited

placement operator new

Definition at line 79 of file OgreMemoryAllocatedObject.h.

## operator new[]() [1/2]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz,
|  | const char * | file,
|  | int | line,
|  | const char * | func
| ) |  |

inherited

array operator new, with debug line info

Definition at line 86 of file OgreMemoryAllocatedObject.h.

## operator new[]() [2/2]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz | ) |

inherited

Definition at line 91 of file OgreMemoryAllocatedObject.h.

## populateFrameEvent()

void Ogre::Root::populateFrameEvent | ( | FrameEventTimeType | type,
|  | FrameEvent & | evtToUpdate
| ) |  |

protected

Update a set of event times (note, progressive, only call once for each type per frame)

## queueEndRendering()

void Ogre::Root::queueEndRendering | ( | bool | state = `true` | ) |

Queues the end of rendering.

Remarks
  This method will do nothing unless startRendering() has been called, in which case before the next frame is rendered the rendering loop will bail out.

See also
  Root, Root::startRendering

## removeFrameListener()

void Ogre::Root::removeFrameListener | ( | FrameListener * | oldListener | ) |

Removes a FrameListener from the list of listening classes.

See also
  FrameListener, Root::addFrameListener

## removeMovableObjectFactory()

void Ogre::Root::removeMovableObjectFactory | ( | MovableObjectFactory * | fact | ) |

Removes a previously registered MovableObjectFactory.

Remarks
  All instances of objects created by this factory will be destroyed before removing the factory (by calling back the factories 'destroyInstance' method). The plugin writer is responsible for actually destroying the factory.

## removeResourceLocation()

void Ogre::Root::removeResourceLocation | ( | const String & | name,
|  | const String & | groupName = `ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME`
| ) |  |

Removes a resource location from the list.

See also
  addResourceLocation

Parameters

  name | The name of the resource location as specified in addResourceLocation
  groupName | The name of the resource group to which this location was assigned.

## removeSceneManagerFactory()

void Ogre::Root::removeSceneManagerFactory | ( | SceneManagerFactory * | fact | ) |

Unregister a SceneManagerFactory.

## renderOneFrame() [1/2]

bool Ogre::Root::renderOneFrame | ( | void |  | ) |

Render one frame.

Remarks
  Updates all the render targets automatically and then returns, raising frame events before and after.

## renderOneFrame() [2/2]

bool Ogre::Root::renderOneFrame | ( | Real | timeSinceLastFrame | ) |

Render one frame, with custom frame time information.

Remarks
  Updates all the render targets automatically and then returns, raising frame events before and after - all per-frame times are based on the time value you pass in.

## restoreConfig()

bool Ogre::Root::restoreConfig | ( | void |  | ) |

Checks for saved video/sound/etc settings.

Remarks
  This method checks to see if there is a valid saved configuration from a previous run. If there is, the state of the system will be restored to that configuration.

Returns
  If a valid configuration was found, true is returned.

  If there is no saved configuration, or if the system failed with the last config settings, false is returned.

## saveConfig()

void Ogre::Root::saveConfig | ( | void |  | ) |

Saves the details of the current configuration.

Remarks
  Stores details of the current configuration so it may be restored later on.

## setBlendIndicesGpuRedundant()

void Ogre::Root::setBlendIndicesGpuRedundant | ( | bool | redundant | ) |

Sets whether blend indices information needs to be passed to the GPU.

When entities use software animation they remove blend information such as indices and weights from the vertex buffers sent to the graphic card. This function can be used to limit which information is removed.

Parameters

  redundant | Set to true to remove blend indices information.

Definition at line 1060 of file OgreRoot.h.

## setBlendWeightsGpuRedundant()

void Ogre::Root::setBlendWeightsGpuRedundant | ( | bool | redundant | ) |

Sets whether blend weights information needs to be passed to the GPU.

When entities use software animation they remove blend information such as indices and weights from the vertex buffers sent to the graphic card. This function can be used to limit which information is removed.

Parameters

  redundant | Set to true to remove blend weights information.

Definition at line 1072 of file OgreRoot.h.

## setDefaultMinPixelSize()

void Ogre::Root::setDefaultMinPixelSize | ( | Real | pixelSize | ) |

Set the default minimum pixel size for object to be rendered by.

Note
  To use this feature see Camera::setUseMinPixelSize()

Definition at line 1082 of file OgreRoot.h.

## setFrameSmoothingPeriod()

void Ogre::Root::setFrameSmoothingPeriod | ( | Real | period | ) |

Sets the period over which OGRE smooths out fluctuations in frame times.

Remarks
  OGRE by default gives you the raw frame time, but can optionally smooths it out over several frames, in order to reduce the noticeable effect of occasional hiccups in framerate. These smoothed values are passed back as parameters to FrameListener calls.

  This method allow you to tweak the smoothing period, and is expressed in seconds. Setting it to 0 will result in completely unsmoothed frame times (the default).

Definition at line 988 of file OgreRoot.h.

## setRemoveRenderQueueStructuresOnClear()

void Ogre::Root::setRemoveRenderQueueStructuresOnClear | ( | bool | r | ) |

Set whether the entire render queue structure should be emptied on clearing, or whether just the objects themselves should be cleared.

Definition at line 356 of file OgreRoot.h.

References Ogre::StringUtil::BLANK, and Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME.

## setRenderSystem()

void Ogre::Root::setRenderSystem | ( | RenderSystem * | system | ) |

Sets the rendering subsystem to be used.

Remarks
  This method indicates to OGRE which rendering system is to be used (e.g. Direct3D, OpenGL etc). This is called automatically by the default config dialog, and when settings are restored from a previous configuraion. If used manually it could be used to set the renderer from a custom settings dialog. Once this has been done, the renderer can be initialised using Root::initialise.

  This method is also called by render systems if they are initialised directly.

Parameters

  system | Pointer to the render system to use.

See also
  RenderSystem

## setWorkQueue()

void Ogre::Root::setWorkQueue | ( | WorkQueue * | queue | ) |

Replace the current work queue with an alternative.

You can use this method to replace the internal implementation of WorkQueue with your own, e.g. to externalise the processing of background events. Doing so will delete the existing queue and replace it with this one.

Parameters

  queue | The new WorkQueue instance. Root will delete this work queue at shutdown, so do not destroy it yourself.

## showConfigDialog()

bool Ogre::Root::showConfigDialog | ( | void |  | ) |

Displays a dialog asking the user to choose system settings.

Remarks
  This method displays the default dialog allowing the user to choose the rendering system, video mode etc. If there is are any settings saved already, they will be restored automatically before displaying the dialogue. When the user accepts a group of settings, this will automatically call Root::setRenderSystem, RenderSystem::setConfigOption and Root::saveConfig with the user's choices. This is the easiest way to get the system configured.

Returns
  If the user clicked 'Ok', true is returned.

  If they clicked 'Cancel' (in which case the app should strongly consider terminating), false is returned.

## shutdown()

void Ogre::Root::shutdown | ( | void |  | ) |

Shuts down the system manually.

Remarks
  This is normally done by Ogre automatically so don't think you have to call this yourself. However this is here for convenience, especially for dealing with unexpected errors or for systems which need to shut down Ogre on demand.

## shutdownPlugins()

void Ogre::Root::shutdownPlugins | ( |  | ) |

protected

Shuts down all loaded plugins - allows things to be tidied up whilst all plugins are still loaded.

## startRendering()

void Ogre::Root::startRendering | ( | void |  | ) |

Starts / restarts the automatic rendering cycle.

Remarks
  This method begins the automatic rendering of the scene. It will NOT return until the rendering cycle is halted.

  During rendering, any FrameListener classes registered using addFrameListener will be called back for each frame that is to be rendered, These classes can tell OGRE to halt the rendering if required, which will cause this method to return.

Note
  Users of the OGRE library do not have to use this automatic rendering loop. It is there as a convenience and is most useful for high frame rate applications e.g. games. For applications that don't need to constantly refresh the rendering targets (e.g. an editor utility), it is better to manually refresh each render target only when required by calling RenderTarget::update, or if you want to run your own render loop you can update all targets on demand using Root::renderOneFrame.
  This frees up the CPU to do other things in between refreshes, since in this case frame rate is less important.
  This method can only be called after Root::initialise has been called.

## uninstallPlugin()

void Ogre::Root::uninstallPlugin | ( | Plugin * | plugin | ) |

Uninstall an existing plugin.

Remarks
  This uninstalls an extension to OGRE. Plugins are automatically uninstalled at shutdown but this lets you remove them early. If the plugin was loaded from a DLL / DSO you should call unloadPlugin which should result in this method getting called anyway (if the DLL is well behaved).

## unloadPlugin()

void Ogre::Root::unloadPlugin | ( | const String & | pluginName | ) |

Manually unloads a Plugin contained in a DLL / DSO.

Remarks
  Plugin DLLs are unloaded at shutdown automatically. This method allows you to unload plugins in code, but make sure their dependencies are decoupled first. This method will call the dllStopPlugin method defined in the DLL, which in turn should call Root::uninstallPlugin.

Parameters

  pluginName | Name of the plugin library to unload

## unloadPlugins()

void Ogre::Root::unloadPlugins | ( |  | ) |

protected

Unloads all loaded plugins.

## useCustomRenderSystemCapabilities()

void Ogre::Root::useCustomRenderSystemCapabilities | ( | RenderSystemCapabilities * | capabilities | ) |

Requests active RenderSystem to use custom RenderSystemCapabilities.

Remarks
  This is useful for testing how the RenderSystem would behave on a machine with less advanced GPUs. This method MUST be called before creating the first RenderWindow

## Friends And Related Function Documentation

## RenderSystem

friend class RenderSystem

friend

Definition at line 75 of file OgreRoot.h.

## Member Data Documentation

## mActiveRenderer

RenderSystem* Ogre::Root::mActiveRenderer

protected

Definition at line 78 of file OgreRoot.h.

## mAddedFrameListeners

set<FrameListener*>::type Ogre::Root::mAddedFrameListeners

protected

Definition at line 188 of file OgreRoot.h.

## mArchiveManager

ArchiveManager* Ogre::Root::mArchiveManager

protected

Definition at line 92 of file OgreRoot.h.

## mAutoWindow

RenderWindow* Ogre::Root::mAutoWindow

protected

Definition at line 116 of file OgreRoot.h.

## mBillboardChainFactory

MovableObjectFactory* Ogre::Root::mBillboardChainFactory

protected

Definition at line 143 of file OgreRoot.h.

## mBillboardSetFactory

MovableObjectFactory* Ogre::Root::mBillboardSetFactory

protected

Definition at line 141 of file OgreRoot.h.

## mCompilerManager

ScriptCompilerManager* Ogre::Root::mCompilerManager

protected

Definition at line 110 of file OgreRoot.h.

## mCompositorManager

CompositorManager* Ogre::Root::mCompositorManager

protected

Definition at line 120 of file OgreRoot.h.

## mConfigFileName

String Ogre::Root::mConfigFileName

protected

Definition at line 80 of file OgreRoot.h.

## mControllerManager

ControllerManager* Ogre::Root::mControllerManager

protected

Definition at line 87 of file OgreRoot.h.

## mDefaultMinPixelSize

Real Ogre::Root::mDefaultMinPixelSize

protected

Definition at line 124 of file OgreRoot.h.

## mDynLibManager

DynLibManager* Ogre::Root::mDynLibManager

protected

Definition at line 91 of file OgreRoot.h.

## mEmbeddedZipArchiveFactory

ArchiveFactory* Ogre::Root::mEmbeddedZipArchiveFactory

protected

Definition at line 99 of file OgreRoot.h.

## mEntityFactory

MovableObjectFactory* Ogre::Root::mEntityFactory

protected

Definition at line 139 of file OgreRoot.h.

## mEventTimes

EventTimesQueue Ogre::Root::mEventTimes[FETT_COUNT]

protected

Definition at line 202 of file OgreRoot.h.

## mExternalTextureSourceManager

ExternalTextureSourceManager* Ogre::Root::mExternalTextureSourceManager

protected

Definition at line 119 of file OgreRoot.h.

## mFileSystemArchiveFactory

ArchiveFactory* Ogre::Root::mFileSystemArchiveFactory

protected

Definition at line 100 of file OgreRoot.h.

## mFirstTimePostWindowInit

bool Ogre::Root::mFirstTimePostWindowInit

protected

In case multiple render windows are created, only once are the resources loaded.

Definition at line 83 of file OgreRoot.h.

## mFrameListeners

set<FrameListener*>::type Ogre::Root::mFrameListeners

protected

Set of registered frame listeners.

Definition at line 184 of file OgreRoot.h.

## mFrameSmoothingTime

Real Ogre::Root::mFrameSmoothingTime

protected

Definition at line 122 of file OgreRoot.h.

## mHighLevelGpuProgramManager

HighLevelGpuProgramManager* Ogre::Root::mHighLevelGpuProgramManager

protected

Definition at line 118 of file OgreRoot.h.

## mIsBlendIndicesGpuRedundant

bool Ogre::Root::mIsBlendIndicesGpuRedundant

protected

Tells whether blend indices information needs to be passed to the GPU.

Definition at line 155 of file OgreRoot.h.

## mIsBlendWeightsGpuRedundant

bool Ogre::Root::mIsBlendWeightsGpuRedundant

protected

Tells whether blend weights information needs to be passed to the GPU.

Definition at line 157 of file OgreRoot.h.

## mIsInitialised

bool Ogre::Root::mIsInitialised

protected

Are we initialised yet?

Definition at line 150 of file OgreRoot.h.

## mLightFactory

MovableObjectFactory* Ogre::Root::mLightFactory

protected

Definition at line 140 of file OgreRoot.h.

## mLodStrategyManager

LodStrategyManager* Ogre::Root::mLodStrategyManager

protected

Definition at line 111 of file OgreRoot.h.

## mLogManager

LogManager* Ogre::Root::mLogManager

protected

Definition at line 86 of file OgreRoot.h.

## mManualObjectFactory

MovableObjectFactory* Ogre::Root::mManualObjectFactory

protected

Definition at line 142 of file OgreRoot.h.

## mMaterialManager

MaterialManager* Ogre::Root::mMaterialManager

protected

Definition at line 93 of file OgreRoot.h.

## mMeshManager

MeshManager* Ogre::Root::mMeshManager

protected

Definition at line 94 of file OgreRoot.h.

## mMovableObjectFactoryMap

MovableObjectFactoryMap Ogre::Root::mMovableObjectFactoryMap

protected

Definition at line 136 of file OgreRoot.h.

## mNextFrame

unsigned long Ogre::Root::mNextFrame

protected

Definition at line 121 of file OgreRoot.h.

## mNextMovableObjectTypeFlag

uint32 Ogre::Root::mNextMovableObjectTypeFlag

protected

Definition at line 137 of file OgreRoot.h.

## mParticleManager

ParticleSystemManager* Ogre::Root::mParticleManager

protected

Definition at line 95 of file OgreRoot.h.

## mPluginLibs

PluginLibList Ogre::Root::mPluginLibs

protected

List of plugin DLLs loaded.

Definition at line 131 of file OgreRoot.h.

## mPlugins

PluginInstanceList Ogre::Root::mPlugins

protected

List of Plugin instances registered.

Definition at line 133 of file OgreRoot.h.

## mPMInjector

PMInjector* Ogre::Root::mPMInjector

protected

Definition at line 113 of file OgreRoot.h.

## mPMWorker

PMWorker* Ogre::Root::mPMWorker

protected

Definition at line 112 of file OgreRoot.h.

## mProfiler

Profiler* Ogre::Root::mProfiler

protected

Definition at line 117 of file OgreRoot.h.

## mQueuedEnd

bool Ogre::Root::mQueuedEnd

protected

Definition at line 81 of file OgreRoot.h.

## mRemovedFrameListeners

set<FrameListener*>::type Ogre::Root::mRemovedFrameListeners

protected

Set of frame listeners marked for removal and addition.

Definition at line 187 of file OgreRoot.h.

## mRemoveQueueStructuresOnClear

bool Ogre::Root::mRemoveQueueStructuresOnClear

protected

Definition at line 123 of file OgreRoot.h.

## mRenderers

RenderSystemList Ogre::Root::mRenderers

protected

Definition at line 77 of file OgreRoot.h.

## mRenderSystemCapabilitiesManager

RenderSystemCapabilitiesManager* Ogre::Root::mRenderSystemCapabilitiesManager

protected

Definition at line 109 of file OgreRoot.h.

## mResourceBackgroundQueue

ResourceBackgroundQueue* Ogre::Root::mResourceBackgroundQueue

protected

Definition at line 107 of file OgreRoot.h.

## mResourceGroupManager

ResourceGroupManager* Ogre::Root::mResourceGroupManager

protected

Definition at line 106 of file OgreRoot.h.

## mRibbonTrailFactory

MovableObjectFactory* Ogre::Root::mRibbonTrailFactory

protected

Definition at line 144 of file OgreRoot.h.

## mRQSequenceMap

RenderQueueInvocationSequenceMap Ogre::Root::mRQSequenceMap

protected

Definition at line 147 of file OgreRoot.h.

## mSceneManagerEnum

SceneManagerEnumerator* Ogre::Root::mSceneManagerEnum

protected

Definition at line 88 of file OgreRoot.h.

## mSceneManagerStack

SceneManagerStack Ogre::Root::mSceneManagerStack

protected

Definition at line 90 of file OgreRoot.h.

## mShadowTextureManager

ShadowTextureManager* Ogre::Root::mShadowTextureManager

protected

Definition at line 108 of file OgreRoot.h.

## mSkeletonManager

SkeletonManager* Ogre::Root::mSkeletonManager

protected

Definition at line 96 of file OgreRoot.h.

## msSingleton

Root * Ogre::Singleton< Root >::msSingleton

static protected inherited

Definition at line 75 of file OgreSingleton.h.

## mTimer

Timer* Ogre::Root::mTimer

protected

Definition at line 115 of file OgreRoot.h.

## mVersion

String Ogre::Root::mVersion

protected

Definition at line 79 of file OgreRoot.h.

## mWorkQueue

WorkQueue* Ogre::Root::mWorkQueue

protected

Definition at line 152 of file OgreRoot.h.

## mZipArchiveFactory

ArchiveFactory* Ogre::Root::mZipArchiveFactory

protected

Definition at line 98 of file OgreRoot.h.

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

- OgreRoot.h

Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.