#include <OgreProfiler.h>
Public Member Functions | |
Profiler () | |
~Profiler () | |
void | setTimer (Timer *t) |
Sets the timer for the profiler. | |
Timer * | getTimer () |
Retrieves the timer for the profiler. | |
void | beginProfile (const String &profileName) |
Begins a profile. | |
void | endProfile (const String &profileName) |
Ends a profile. | |
void | setEnabled (bool enabled) |
Sets whether this profiler is enabled. | |
bool | getEnabled () const |
Gets whether this profiler is enabled. | |
void | enableProfile (const String &profileName) |
Enables a previously disabled profile. | |
void | disableProfile (const String &profileName) |
Disables a profile. | |
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. | |
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. | |
void | logResults () |
Outputs current profile statistics to the log. | |
void | reset () |
Clears the profiler statistics. | |
void | setUpdateDisplayFrequency (uint freq) |
Sets the Profiler so the display of results are updated ever n frames. | |
uint | getUpdateDisplayFrequency () const |
Gets the frequency that the Profiler display is updated. | |
void * | operator new (size_t sz, const char *file, int line, const char *func) |
operator new, with debug line info | |
void * | operator new (size_t sz) |
void * | operator new (size_t sz, void *ptr) |
placement operator new | |
void * | operator new[] (size_t sz, const char *file, int line, const char *func) |
array operator new, with debug line info | |
void * | operator new[] (size_t sz) |
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 *) |
Static Public Member Functions | |
static Profiler & | getSingleton (void) |
Override standard Singleton retrieval. | |
static Profiler * | getSingletonPtr (void) |
Override standard Singleton retrieval. | |
Protected Types | |
typedef std::list < ProfileInstance > | ProfileStack |
typedef std::list< ProfileFrame > | ProfileFrameList |
typedef std::list< ProfileHistory > | ProfileHistoryList |
typedef std::map< String, ProfileHistoryList::iterator > | ProfileHistoryMap |
typedef std::map< String, bool > | DisabledProfileMap |
typedef std::list < OverlayElement * > | ProfileBarList |
Protected Member Functions | |
void | initialize () |
Initializes the profiler's GUI elements. | |
void | displayResults () |
Prints the profiling results of each frame. | |
void | processFrameStats () |
Processes the profiler data after each frame. | |
void | changeEnableState () |
Handles a change of the profiler's enabled state. | |
OverlayContainer * | createContainer () |
An internal function to create the container which will hold our display elements. | |
OverlayElement * | createTextArea (const String &name, Real width, Real height, Real top, Real left, uint fontSize, const String &caption, bool show=true) |
An internal function to create a text area. | |
OverlayElement * | createPanel (const String &name, Real width, Real height, Real top, Real left, const String &materialName, bool show=true) |
An internal function to create a panel. | |
Protected Attributes | |
ProfileStack | mProfiles |
A stack for each individual profile per frame. | |
ProfileFrameList | mProfileFrame |
Accumulates the results of each profile per frame (since a profile can be called more than once a frame). | |
ProfileHistoryList | mProfileHistory |
Keeps track of the statistics of each profile. | |
ProfileHistoryMap | mProfileHistoryMap |
We use this for quick look-ups of profiles in the history list. | |
DisabledProfileMap | mDisabledProfiles |
Holds the names of disabled profiles. | |
ProfileBarList | mProfileBars |
Holds the display bars for each profile results. | |
bool | mInitialized |
Whether the GUI elements have been initialized. | |
uint | maxProfiles |
The max number of profiles we can display. | |
Overlay * | mOverlay |
The overlay which contains our profiler results display. | |
OverlayContainer * | mProfileGui |
The window that displays the profiler results. | |
Real | mBarHeight |
The height of each bar. | |
Real | mGuiHeight |
The height of the stats window. | |
Real | mGuiWidth |
The width of the stats window. | |
Real | mBarIndent |
The size of the indent for each profile display bar. | |
Real | mGuiBorderWidth |
The width of the border between the profile window and each bar. | |
Real | mBarLineWidth |
The width of the min, avg, and max lines in a profile display. | |
uint | mUpdateDisplayFrequency |
The number of frames that must elapse before the current frame display is updated. | |
uint | mCurrentFrame |
The number of elapsed frame, used with mUpdateDisplayFrequency. | |
Timer * | mTimer |
The timer used for profiling. | |
ulong | mTotalFrameTime |
The total time each frame takes. | |
bool | mEnabled |
Whether this profiler is enabled. | |
bool | mEnableStateChangePending |
Keeps track of whether this profiler has received a request to be enabled/disabled. | |
bool | mNewEnableState |
Keeps track of the new enabled/disabled state that the user has requested which will be applied after the frame ends. | |
Static Protected Attributes | |
static T * | ms_Singleton |
Classes | |
struct | ProfileFrame |
Represents the total timing information of a profile since profiles can be called more than once each frame. More... | |
struct | ProfileHistory |
Represents a history of each profile during the duration of the app. More... | |
struct | ProfileInstance |
Represents an individual profile call. More... |
Definition at line 103 of file OgreProfiler.h.
typedef std::list<ProfileInstance> Ogre::Profiler::ProfileStack [protected] |
Definition at line 330 of file OgreProfiler.h.
typedef std::list<ProfileFrame> Ogre::Profiler::ProfileFrameList [protected] |
Definition at line 331 of file OgreProfiler.h.
typedef std::list<ProfileHistory> Ogre::Profiler::ProfileHistoryList [protected] |
Definition at line 332 of file OgreProfiler.h.
typedef std::map<String, ProfileHistoryList::iterator> Ogre::Profiler::ProfileHistoryMap [protected] |
Definition at line 333 of file OgreProfiler.h.
typedef std::map<String, bool> Ogre::Profiler::DisabledProfileMap [protected] |
Definition at line 334 of file OgreProfiler.h.
typedef std::list<OverlayElement*> Ogre::Profiler::ProfileBarList [protected] |
Definition at line 336 of file OgreProfiler.h.
Ogre::Profiler::Profiler | ( | ) |
Ogre::Profiler::~Profiler | ( | ) |
void Ogre::Profiler::setTimer | ( | Timer * | t | ) |
Sets the timer for the profiler.
Timer* Ogre::Profiler::getTimer | ( | ) |
Retrieves the timer for the profiler.
void Ogre::Profiler::beginProfile | ( | const String & | profileName | ) |
Begins a profile.
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 |
void Ogre::Profiler::endProfile | ( | const String & | profileName | ) |
Ends a profile.
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.
void Ogre::Profiler::setEnabled | ( | bool | enabled | ) |
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.
void Ogre::Profiler::enableProfile | ( | const String & | profileName | ) |
Enables a previously disabled profile.
void Ogre::Profiler::disableProfile | ( | const String & | profileName | ) |
Disables a profile.
bool Ogre::Profiler::watchForMax | ( | const String & | profileName | ) |
Returns true if the specified profile reaches a new frame time maximum.
bool Ogre::Profiler::watchForMin | ( | const String & | profileName | ) |
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.
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.
void Ogre::Profiler::setUpdateDisplayFrequency | ( | uint | freq | ) |
Sets the Profiler so the display of results are updated ever n frames.
uint Ogre::Profiler::getUpdateDisplayFrequency | ( | ) | const |
Gets the frequency that the Profiler display is updated.
static Profiler& Ogre::Profiler::getSingleton | ( | void | ) | [static] |
Override standard Singleton retrieval.
Reimplemented from Ogre::Singleton< T >.
static Profiler* Ogre::Profiler::getSingletonPtr | ( | void | ) | [static] |
Override standard Singleton retrieval.
Reimplemented from Ogre::Singleton< T >.
void Ogre::Profiler::initialize | ( | ) | [protected] |
Initializes the profiler's GUI elements.
void Ogre::Profiler::displayResults | ( | ) | [protected] |
Prints the profiling results of each frame.
void Ogre::Profiler::processFrameStats | ( | ) | [protected] |
Processes the profiler data after each frame.
void Ogre::Profiler::changeEnableState | ( | ) | [protected] |
Handles a change of the profiler's enabled state.
OverlayContainer* Ogre::Profiler::createContainer | ( | ) | [protected] |
An internal function to create the container which will hold our display elements.
OverlayElement* Ogre::Profiler::createTextArea | ( | const String & | name, | |
Real | width, | |||
Real | height, | |||
Real | top, | |||
Real | left, | |||
uint | fontSize, | |||
const String & | caption, | |||
bool | show = true | |||
) | [protected] |
An internal function to create a text area.
OverlayElement* Ogre::Profiler::createPanel | ( | const String & | name, | |
Real | width, | |||
Real | height, | |||
Real | top, | |||
Real | left, | |||
const String & | materialName, | |||
bool | show = true | |||
) | [protected] |
An internal function to create a panel.
void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz, | |
const char * | file, | |||
int | line, | |||
const char * | func | |||
) | [inherited] |
void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz | ) | [inherited] |
Definition at line 67 of file OgreMemoryAllocatedObject.h.
void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz, | |
void * | ptr | |||
) | [inherited] |
void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz, | |
const char * | file, | |||
int | line, | |||
const char * | func | |||
) | [inherited] |
void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz | ) | [inherited] |
Definition at line 84 of file OgreMemoryAllocatedObject.h.
void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr | ) | [inherited] |
Definition at line 89 of file OgreMemoryAllocatedObject.h.
void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr, | |
void * | ||||
) | [inherited] |
Definition at line 95 of file OgreMemoryAllocatedObject.h.
void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr, | |
const char * | , | |||
int | , | |||
const char * | ||||
) | [inherited] |
Definition at line 101 of file OgreMemoryAllocatedObject.h.
void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr | ) | [inherited] |
Definition at line 106 of file OgreMemoryAllocatedObject.h.
void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr, | |
const char * | , | |||
int | , | |||
const char * | ||||
) | [inherited] |
Definition at line 112 of file OgreMemoryAllocatedObject.h.
ProfileStack Ogre::Profiler::mProfiles [protected] |
ProfileFrameList Ogre::Profiler::mProfileFrame [protected] |
Accumulates the results of each profile per frame (since a profile can be called more than once a frame).
Definition at line 343 of file OgreProfiler.h.
ProfileHistoryList Ogre::Profiler::mProfileHistory [protected] |
ProfileHistoryMap Ogre::Profiler::mProfileHistoryMap [protected] |
We use this for quick look-ups of profiles in the history list.
Definition at line 349 of file OgreProfiler.h.
DisabledProfileMap Ogre::Profiler::mDisabledProfiles [protected] |
ProfileBarList Ogre::Profiler::mProfileBars [protected] |
bool Ogre::Profiler::mInitialized [protected] |
uint Ogre::Profiler::maxProfiles [protected] |
Overlay* Ogre::Profiler::mOverlay [protected] |
The overlay which contains our profiler results display.
Definition at line 364 of file OgreProfiler.h.
OverlayContainer* Ogre::Profiler::mProfileGui [protected] |
Real Ogre::Profiler::mBarHeight [protected] |
Real Ogre::Profiler::mGuiHeight [protected] |
Real Ogre::Profiler::mGuiWidth [protected] |
Real Ogre::Profiler::mBarIndent [protected] |
Real Ogre::Profiler::mGuiBorderWidth [protected] |
The width of the border between the profile window and each bar.
Definition at line 382 of file OgreProfiler.h.
Real Ogre::Profiler::mBarLineWidth [protected] |
The width of the min, avg, and max lines in a profile display.
Definition at line 385 of file OgreProfiler.h.
uint Ogre::Profiler::mUpdateDisplayFrequency [protected] |
The number of frames that must elapse before the current frame display is updated.
Definition at line 389 of file OgreProfiler.h.
uint Ogre::Profiler::mCurrentFrame [protected] |
The number of elapsed frame, used with mUpdateDisplayFrequency.
Definition at line 392 of file OgreProfiler.h.
Timer* Ogre::Profiler::mTimer [protected] |
ulong Ogre::Profiler::mTotalFrameTime [protected] |
bool Ogre::Profiler::mEnabled [protected] |
bool Ogre::Profiler::mEnableStateChangePending [protected] |
Keeps track of whether this profiler has received a request to be enabled/disabled.
Definition at line 405 of file OgreProfiler.h.
bool Ogre::Profiler::mNewEnableState [protected] |
Keeps track of the new enabled/disabled state that the user has requested which will be applied after the frame ends.
Definition at line 409 of file OgreProfiler.h.
T* Ogre::Singleton< T >::ms_Singleton [static, protected, inherited] |
Copyright © 2008 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Sep 27 22:05:16 2009