#include <OgreProfiler.h>
Inheritance diagram for Ogre::Profiler:
Public Methods | |
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. | |
Static Public Methods | |
Profiler & | getSingleton (void) |
Override standard Singleton retrieval. | |
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< GuiElement * > | ProfileBarList |
Protected Methods | |
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. | |
GuiContainer * | createContainer () |
An internal function to create the container which will hold our display elements. | |
GuiElement * | 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. | |
GuiElement * | 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. | |
GuiContainer * | 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 elasped 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 | |
Profiler * | ms_Singleton = 0 |
fix display ordering of profiles not called every frame
Definition at line 98 of file OgreProfiler.h.
|
Definition at line 329 of file OgreProfiler.h. |
|
Definition at line 331 of file OgreProfiler.h. |
|
Definition at line 326 of file OgreProfiler.h. |
|
Definition at line 327 of file OgreProfiler.h. |
|
Definition at line 328 of file OgreProfiler.h. |
|
Definition at line 325 of file OgreProfiler.h. |
|
Definition at line 82 of file OgreProfiler.cpp. References maxProfiles, mCurrentFrame, mEnabled, mEnableStateChangePending, mInitialized, mNewEnableState, mTimer, mTotalFrameTime, and mUpdateDisplayFrequency. |
|
Definition at line 99 of file OgreProfiler.cpp. References logResults(), mDisabledProfiles, mProfileBars, mProfileFrame, mProfileHistory, mProfileHistoryMap, and mProfiles. |
|
|
Handles a change of the profiler's enabled state.
Definition at line 752 of file OgreProfiler.cpp. References Ogre::Overlay::hide(), mEnabled, mEnableStateChangePending, mNewEnableState, mOverlay, and Ogre::Overlay::show(). Referenced by endProfile(). |
|
An internal function to create the container which will hold our display elements.
Definition at line 769 of file OgreProfiler.cpp. References Ogre::GMM_PIXELS, mGuiHeight, mGuiWidth, Ogre::GuiElement::setHeight(), Ogre::GuiElement::setLeft(), Ogre::GuiElement::setMaterialName(), Ogre::GuiElement::setMetricsMode(), Ogre::StringInterface::setParameter(), Ogre::GuiElement::setTop(), and Ogre::GuiElement::setWidth(). Referenced by initialize(). |
|
An internal function to create a panel.
Definition at line 820 of file OgreProfiler.cpp. References Ogre::GMM_PIXELS, Ogre::GuiElement::hide(), Ogre::Real, Ogre::GuiElement::setHeight(), Ogre::GuiElement::setLeft(), Ogre::GuiElement::setMaterialName(), Ogre::GuiElement::setMetricsMode(), Ogre::GuiElement::setTop(), Ogre::GuiElement::setWidth(), Ogre::GuiElement::show(), and Ogre::String. Referenced by initialize(). |
|
An internal function to create a text area.
Definition at line 793 of file OgreProfiler.cpp. References Ogre::GMM_PIXELS, Ogre::GuiElement::hide(), Ogre::Real, Ogre::GuiElement::setCaption(), Ogre::GuiElement::setHeight(), Ogre::GuiElement::setLeft(), Ogre::GuiElement::setMetricsMode(), Ogre::StringInterface::setParameter(), Ogre::GuiElement::setTop(), Ogre::GuiElement::setWidth(), Ogre::GuiElement::show(), Ogre::String, and Ogre::uint. Referenced by initialize(). |
|
Disables a profile.
Definition at line 232 of file OgreProfiler.cpp. References mDisabledProfiles, mProfiles, and Ogre::String. |
|
Prints the profiling results of each frame.
Definition at line 549 of file OgreProfiler.cpp. References Ogre::GMM_PIXELS, mBarHeight, mBarIndent, mCurrentFrame, mEnabled, mGuiBorderWidth, mGuiHeight, mGuiWidth, mProfileBars, mProfileGui, mProfileHistory, mUpdateDisplayFrequency, Ogre::Real, Ogre::GuiElement::setCaption(), Ogre::GuiElement::setHeight(), Ogre::GuiElement::setLeft(), Ogre::GuiElement::setMetricsMode(), Ogre::GuiElement::setTop(), Ogre::GuiElement::setWidth(), and Ogre::GuiElement::show(). Referenced by endProfile(). |
|
Enables a previously disabled profile.
Definition at line 256 of file OgreProfiler.cpp. References mDisabledProfiles, mProfiles, and Ogre::String. |
|
Ends a profile.
Definition at line 393 of file OgreProfiler.cpp. References Ogre::Profiler::ProfileInstance::accum, changeEnableState(), Ogre::Profiler::ProfileInstance::currTime, displayResults(), Ogre::Timer::getMicroseconds(), mDisabledProfiles, mEnabled, mProfileFrame, mProfiles, mTimer, mTotalFrameTime, Ogre::Profiler::ProfileInstance::name, Ogre::Profiler::ProfileInstance::parent, processFrameStats(), Ogre::String, and Ogre::ulong. Referenced by Ogre::Profile::~Profile(). |
|
Gets whether this profiler is enabled.
Definition at line 226 of file OgreProfiler.cpp. References mEnabled. |
|
Override standard Singleton retrieval.
Reimplemented from Ogre::Singleton< Profiler >. Definition at line 58 of file OgreProfiler.cpp. References Ogre::Singleton< Profiler >::ms_Singleton. Referenced by Ogre::Profile::Profile(), and Ogre::Profile::~Profile(). |
|
Override standard Singleton retrieval.
Reimplemented from Ogre::Singleton< Profiler >. Definition at line 54 of file OgreProfiler.cpp. References Ogre::Singleton< Profiler >::ms_Singleton. |
|
Retrieves the timer for the profiler.
Definition at line 199 of file OgreProfiler.cpp. References mTimer. |
|
Gets the frequency that the Profiler display is updated.
Definition at line 746 of file OgreProfiler.cpp. References mUpdateDisplayFrequency, and Ogre::uint. |
|
Initializes the profiler's gui elements.
Definition at line 116 of file OgreProfiler.cpp. References Ogre::Overlay::add2D(), Ogre::GuiContainer::addChild(), createContainer(), createPanel(), createTextArea(), maxProfiles, mBarHeight, mBarIndent, mBarLineWidth, mGuiBorderWidth, mGuiHeight, mGuiWidth, mOverlay, mProfileBars, mProfileGui, Ogre::Overlay::setZOrder(), Ogre::Overlay::show(), and Ogre::uint. Referenced by setEnabled(). |
|
Outputs current profile statistics to the log.
Definition at line 702 of file OgreProfiler.cpp. References mProfileHistory, Ogre::String, and Ogre::uint. Referenced by ~Profiler(). |
|
Processes the profiler data after each frame.
Definition at line 495 of file OgreProfiler.cpp. References mProfileFrame, mProfileHistory, mProfileHistoryMap, mTotalFrameTime, Ogre::Real, Ogre::String, Ogre::uint, and Ogre::ulong. Referenced by endProfile(). |
|
Clears the profiler statistics.
Definition at line 726 of file OgreProfiler.cpp. References mProfileHistory. |
|
Sets whether this profiler is enabled. Only takes effect after the the frame has ended.
Definition at line 206 of file OgreProfiler.cpp. References initialize(), mEnabled, mEnableStateChangePending, mInitialized, and mNewEnableState. |
|
Sets the timer for the profiler.
Definition at line 193 of file OgreProfiler.cpp. References mTimer. |
|
Sets the Profiler so the display of results are updated ever n frames.
Definition at line 740 of file OgreProfiler.cpp. References mUpdateDisplayFrequency, and Ogre::uint. |
|
Returns true if the specified profile goes over or under the given limit frame time.
Definition at line 682 of file OgreProfiler.cpp. References mProfileHistoryMap, Ogre::Real, and Ogre::String. |
|
Returns true if the specified profile reaches a new frame time maximum.
Definition at line 648 of file OgreProfiler.cpp. References mProfileHistoryMap, and Ogre::String. |
|
Returns true if the specified profile reaches a new frame time minimum.
Definition at line 665 of file OgreProfiler.cpp. References mProfileHistoryMap, and Ogre::String. |
|
The max number of profiles we can display.
Definition at line 356 of file OgreProfiler.h. Referenced by initialize(), and Profiler(). |
|
The height of each bar.
Definition at line 365 of file OgreProfiler.h. Referenced by displayResults(), and initialize(). |
|
The size of the indent for each profile display bar.
Definition at line 374 of file OgreProfiler.h. Referenced by displayResults(), and initialize(). |
|
The width of the min, avg, and max lines in a profile display.
Definition at line 380 of file OgreProfiler.h. Referenced by initialize(). |
|
The number of elasped frame, used with mUpdateDisplayFrequency.
Definition at line 387 of file OgreProfiler.h. Referenced by displayResults(), and Profiler(). |
|
Holds the names of disabled profiles.
Definition at line 347 of file OgreProfiler.h. Referenced by beginProfile(), disableProfile(), enableProfile(), endProfile(), and ~Profiler(). |
|
Whether this profiler is enabled.
Definition at line 396 of file OgreProfiler.h. Referenced by beginProfile(), changeEnableState(), displayResults(), endProfile(), getEnabled(), Profiler(), and setEnabled(). |
|
Keeps track of whether this profiler has received a request to be enabled/disabled.
Definition at line 400 of file OgreProfiler.h. Referenced by changeEnableState(), Profiler(), and setEnabled(). |
|
The width of the border between the profile window and each bar.
Definition at line 377 of file OgreProfiler.h. Referenced by displayResults(), and initialize(). |
|
The height of the stats window.
Definition at line 368 of file OgreProfiler.h. Referenced by createContainer(), displayResults(), and initialize(). |
|
The width of the stats window.
Definition at line 371 of file OgreProfiler.h. Referenced by createContainer(), displayResults(), and initialize(). |
|
Whether the GUI elements have been initialized.
Definition at line 353 of file OgreProfiler.h. Referenced by Profiler(), and setEnabled(). |
|
Keeps track of the new enabled/disabled state that the user has requested which will be applied after the frame ends.
Definition at line 404 of file OgreProfiler.h. Referenced by changeEnableState(), Profiler(), and setEnabled(). |
|
The overlay which contains our profiler results display.
Definition at line 359 of file OgreProfiler.h. Referenced by changeEnableState(), and initialize(). |
|
Holds the display bars for each profile results.
Definition at line 350 of file OgreProfiler.h. Referenced by displayResults(), initialize(), and ~Profiler(). |
|
Accumulates the results of each profile per frame (since a profile can be called more than once a frame).
Definition at line 338 of file OgreProfiler.h. Referenced by beginProfile(), endProfile(), processFrameStats(), and ~Profiler(). |
|
The window that displays the profiler results.
Definition at line 362 of file OgreProfiler.h. Referenced by displayResults(), and initialize(). |
|
Keeps track of the statistics of each profile.
Definition at line 341 of file OgreProfiler.h. Referenced by beginProfile(), displayResults(), logResults(), processFrameStats(), reset(), and ~Profiler(). |
|
We use this for quick look-ups of profiles in the history list.
Definition at line 344 of file OgreProfiler.h. Referenced by beginProfile(), processFrameStats(), watchForLimit(), watchForMax(), watchForMin(), and ~Profiler(). |
|
A stack for each individual profile per frame.
Definition at line 334 of file OgreProfiler.h. Referenced by beginProfile(), disableProfile(), enableProfile(), endProfile(), and ~Profiler(). |
|
Definition at line 53 of file OgreProfiler.cpp. Referenced by getSingleton(), and getSingletonPtr(). |
|
The timer used for profiling.
Definition at line 390 of file OgreProfiler.h. Referenced by beginProfile(), endProfile(), getTimer(), Profiler(), and setTimer(). |
|
The total time each frame takes.
Definition at line 393 of file OgreProfiler.h. Referenced by endProfile(), processFrameStats(), and Profiler(). |
|
The number of frames that must elapse before the current frame display is updated.
Definition at line 384 of file OgreProfiler.h. Referenced by displayResults(), getUpdateDisplayFrequency(), Profiler(), and setUpdateDisplayFrequency(). |
Copyright © 2002-2003 by The OGRE Team
Last modified Sun Nov 28 19:51:27 2004