OGRE 14.3
Object-Oriented Graphics Rendering Engine
|
The profiler allows you to measure the performance of your code. More...
#include <OgreProfiler.h>
Public Member Functions | |
Profiler () | |
~Profiler () | |
void | addListener (ProfileSessionListener *listener) |
Register a ProfileSessionListener from the Profiler. | |
void | beginProfile (const String &profileName, uint32 groupID=(uint32) OGREPROF_USER_DEFAULT) |
Begins a profile. | |
void | disableProfile (const String &profileName) |
Disables a profile. | |
void | enableProfile (const String &profileName) |
Enables a previously disabled profile. | |
void | endProfile (const String &profileName, uint32 groupID=(uint32) OGREPROF_USER_DEFAULT) |
Ends a profile. | |
bool | getEnabled () const |
Gets whether this profiler is enabled. | |
uint32 | getProfileGroupMask () const |
Get the mask which all profiles must pass to be enabled. | |
Timer * | getTimer () |
Retrieves the timer for the profiler. | |
uint | getUpdateDisplayFrequency () const |
Gets the frequency that the Profiler display is updated. | |
void | logResults () |
Outputs current profile statistics to the log. | |
void | removeListener (ProfileSessionListener *listener) |
Unregister a ProfileSessionListener from the Profiler. | |
void | reset () |
Clears the profiler statistics. | |
void | setEnabled (bool enabled) |
Sets whether this profiler is enabled. | |
void | setProfileGroupMask (uint32 mask) |
Set the mask which all profiles must pass to be enabled. | |
void | setTimer (Timer *t) |
Sets the timer for the profiler. | |
void | setUpdateDisplayFrequency (uint freq) |
Sets the Profiler so the display of results are updated every n frames. | |
bool | watchForLimit (const String &profileName, Real limit, bool greaterThan=true) |
Returns true if the specified profile goes over or under the given limit frame time. | |
bool | watchForMax (const String &profileName) |
Returns true if the specified profile reaches a new frame time maximum. | |
bool | watchForMin (const String &profileName) |
Returns true if the specified profile reaches a new frame time minimum. | |
Public Member Functions inherited from Ogre::Singleton< Profiler > | |
Singleton (void) | |
~Singleton (void) | |
Static Public Member Functions | |
static Profiler & | getSingleton (void) |
Get the singleton instance. | |
static Profiler * | getSingletonPtr (void) |
Get the singleton instance. | |
Static Public Member Functions inherited from Ogre::Singleton< Profiler > | |
static Profiler & | getSingleton (void) |
Get the singleton instance. | |
static Profiler * | getSingletonPtr (void) |
Get the singleton instance. | |
The profiler allows you to measure the performance of your code.
Do not create profiles directly from this unless you want a profile to last outside of its scope (i.e. the main game loop). For most cases, use the macro OgreProfile(name) and braces to limit the scope. You must enable the Profile before you can used it with setEnabled(true). If you want to disable profiling in Ogre, simply set the macro OGRE_PROFILING to 0.
Ogre::Profiler::Profiler | ( | ) |
Ogre::Profiler::~Profiler | ( | ) |
Timer * Ogre::Profiler::getTimer | ( | ) |
Retrieves the timer for the profiler.
void Ogre::Profiler::beginProfile | ( | const String & | profileName, |
uint32 | groupID = (uint32) OGREPROF_USER_DEFAULT |
||
) |
Begins a profile.
Use the macro OgreProfileBegin(name) instead of calling this directly so that profiling can be ignored in the release version of your app.
You only use the macro (or this) if you want a profile to last outside of its scope (i.e. the main game loop). If you use this function, make sure you use a corresponding OgreProfileEnd(name). Usually you would use the macro OgreProfile(name). This function will be ignored for a profile that has been disabled or if the profiler is disabled.
profileName | Must be unique and must not be an empty string |
groupID | A profile group identifier, which can allow you to mask profiles |
void Ogre::Profiler::endProfile | ( | const String & | profileName, |
uint32 | groupID = (uint32) OGREPROF_USER_DEFAULT |
||
) |
Ends a profile.
Use the macro OgreProfileEnd(name) instead of calling this directly so that profiling can be ignored in the release version of your app.
This function is usually not called directly unless you want a profile to last outside of its scope. In most cases, using the macro OgreProfile(name) which will call this function automatically when it goes out of scope. Make sure the name of this profile matches its corresponding beginProfile name. This function will be ignored for a profile that has been disabled or if the profiler is disabled.
profileName | Must be unique and must not be an empty string |
groupID | A profile group identifier, which can allow you to mask profiles |
Sets whether this profiler is enabled.
Only takes effect after the the frame has ended.
bool Ogre::Profiler::getEnabled | ( | ) | const |
Gets whether this profiler is enabled.
Enables a previously disabled profile.
Disables a profile.
Set the mask which all profiles must pass to be enabled.
|
inline |
Get the mask which all profiles must pass to be enabled.
Returns true if the specified profile reaches a new frame time maximum.
Returns true if the specified profile reaches a new frame time minimum.
bool Ogre::Profiler::watchForLimit | ( | const String & | profileName, |
Real | limit, | ||
bool | greaterThan = true |
||
) |
Returns true if the specified profile goes over or under the given limit frame time.
profileName | Must be unique and must not be an empty string |
limit | A number between 0 and 1 representing the percentage of frame time |
greaterThan | If true, this will return whether the limit is exceeded. Otherwise, it will return if the frame time has gone under this limit. |
void Ogre::Profiler::logResults | ( | ) |
Outputs current profile statistics to the log.
void Ogre::Profiler::reset | ( | ) |
Clears the profiler statistics.
Sets the Profiler so the display of results are updated every n frames.
uint Ogre::Profiler::getUpdateDisplayFrequency | ( | ) | const |
Gets the frequency that the Profiler display is updated.
void Ogre::Profiler::addListener | ( | ProfileSessionListener * | listener | ) |
Register a ProfileSessionListener from the Profiler.
listener | A valid listener derived class |
void Ogre::Profiler::removeListener | ( | ProfileSessionListener * | listener | ) |
Unregister a ProfileSessionListener from the Profiler.
listener | A valid listener derived class |
Get the singleton instance.
Referenced by Ogre::Profile::Profile(), and Ogre::Profile::~Profile().