#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 () |
| Profiler * | getSingletonPtr (void) |
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 298 of file OgreProfiler.h. |
|
|
Definition at line 300 of file OgreProfiler.h. |
|
|
Definition at line 295 of file OgreProfiler.h. |
|
|
Definition at line 296 of file OgreProfiler.h. |
|
|
Definition at line 297 of file OgreProfiler.h. |
|
|
Definition at line 294 of file OgreProfiler.h. |
|
|
Definition at line 74 of file OgreProfiler.cpp. References maxProfiles, mCurrentFrame, mEnabled, mEnableStateChangePending, mInitialized, mNewEnableState, mTimer, mTotalFrameTime, and mUpdateDisplayFrequency. |
|
|
Definition at line 91 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 744 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 761 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 812 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(), and Ogre::GuiElement::show(). Referenced by initialize(). |
|
||||||||||||||||||||||||||||||||||||
|
An internal function to create a text area.
Definition at line 785 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(), and Ogre::uint. Referenced by initialize(). |
|
|
Disables a profile.
Definition at line 224 of file OgreProfiler.cpp. References mDisabledProfiles, and mProfiles. |
|
|
Prints the profiling results of each frame.
Definition at line 541 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 248 of file OgreProfiler.cpp. References mDisabledProfiles, and mProfiles. |
|
|
Ends a profile.
Definition at line 385 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(), and Ogre::ulong. Referenced by Ogre::Profile::~Profile(). |
|
|
Gets whether this profiler is enabled.
Definition at line 218 of file OgreProfiler.cpp. References mEnabled. |
|
|
Reimplemented from Ogre::Singleton< Profiler >. Definition at line 834 of file OgreProfiler.cpp. Referenced by Ogre::Profile::Profile(), and Ogre::Profile::~Profile(). |
|
|
Definition at line 71 of file OgreSingleton.h. |
|
|
Retrieves the timer for the profiler.
Definition at line 191 of file OgreProfiler.cpp. References mTimer. |
|
|
Gets the frequency that the Profiler display is updated.
Definition at line 738 of file OgreProfiler.cpp. References mUpdateDisplayFrequency, and Ogre::uint. |
|
|
Initializes the profiler's gui elements.
Definition at line 108 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 694 of file OgreProfiler.cpp. References mProfileHistory, and Ogre::uint. Referenced by ~Profiler(). |
|
|
Processes the profiler data after each frame.
Definition at line 487 of file OgreProfiler.cpp. References mProfileFrame, mProfileHistory, mProfileHistoryMap, mTotalFrameTime, Ogre::Real, Ogre::uint, and Ogre::ulong. Referenced by endProfile(). |
|
|
Clears the profiler statistics.
Definition at line 718 of file OgreProfiler.cpp. References mProfileHistory. |
|
|
Sets whether this profiler is enabled. Only takes effect after the the frame has ended.
Definition at line 198 of file OgreProfiler.cpp. References initialize(), mEnabled, mEnableStateChangePending, mInitialized, and mNewEnableState. |
|
|
Sets the timer for the profiler.
Definition at line 185 of file OgreProfiler.cpp. References mTimer. |
|
|
Sets the Profiler so the display of results are updated ever n frames.
Definition at line 732 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 674 of file OgreProfiler.cpp. References mProfileHistoryMap, and Ogre::Real. |
|
|
Returns true if the specified profile reaches a new frame time maximum.
Definition at line 640 of file OgreProfiler.cpp. References mProfileHistoryMap. |
|
|
Returns true if the specified profile reaches a new frame time minimum.
Definition at line 657 of file OgreProfiler.cpp. References mProfileHistoryMap. |
|
|
The max number of profiles we can display.
Definition at line 325 of file OgreProfiler.h. Referenced by initialize(), and Profiler(). |
|
|
The height of each bar.
Definition at line 334 of file OgreProfiler.h. Referenced by displayResults(), and initialize(). |
|
|
The size of the indent for each profile display bar.
Definition at line 343 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 349 of file OgreProfiler.h. Referenced by initialize(). |
|
|
The number of elasped frame, used with mUpdateDisplayFrequency.
Definition at line 356 of file OgreProfiler.h. Referenced by displayResults(), and Profiler(). |
|
|
Holds the names of disabled profiles.
Definition at line 316 of file OgreProfiler.h. Referenced by beginProfile(), disableProfile(), enableProfile(), endProfile(), and ~Profiler(). |
|
|
Whether this profiler is enabled.
Definition at line 365 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 369 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 346 of file OgreProfiler.h. Referenced by displayResults(), and initialize(). |
|
|
The height of the stats window.
Definition at line 337 of file OgreProfiler.h. Referenced by createContainer(), displayResults(), and initialize(). |
|
|
The width of the stats window.
Definition at line 340 of file OgreProfiler.h. Referenced by createContainer(), displayResults(), and initialize(). |
|
|
Whether the GUI elements have been initialized.
Definition at line 322 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 373 of file OgreProfiler.h. Referenced by changeEnableState(), Profiler(), and setEnabled(). |
|
|
The overlay which contains our profiler results display.
Definition at line 328 of file OgreProfiler.h. Referenced by changeEnableState(), and initialize(). |
|
|
Holds the display bars for each profile results.
Definition at line 319 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 307 of file OgreProfiler.h. Referenced by beginProfile(), endProfile(), processFrameStats(), and ~Profiler(). |
|
|
The window that displays the profiler results.
Definition at line 331 of file OgreProfiler.h. Referenced by displayResults(), and initialize(). |
|
|
Keeps track of the statistics of each profile.
Definition at line 310 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 313 of file OgreProfiler.h. Referenced by beginProfile(), processFrameStats(), watchForLimit(), watchForMax(), watchForMin(), and ~Profiler(). |
|
|
A stack for each individual profile per frame.
Definition at line 303 of file OgreProfiler.h. Referenced by beginProfile(), disableProfile(), enableProfile(), endProfile(), and ~Profiler(). |
|
|
Definition at line 72 of file OgreProfiler.cpp. |
|
|
The timer used for profiling.
Definition at line 359 of file OgreProfiler.h. Referenced by beginProfile(), endProfile(), getTimer(), Profiler(), and setTimer(). |
|
|
The total time each frame takes.
Definition at line 362 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 353 of file OgreProfiler.h. Referenced by displayResults(), getUpdateDisplayFrequency(), Profiler(), and setUpdateDisplayFrequency(). |
Copyright © 2002-2003 by The OGRE Team
Last modified Wed Jan 21 00:19:17 2004