OgreOverlayProfileSessionListener.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of OGRE
4  (Object-oriented Graphics Rendering Engine)
5 For the latest info, see http://www.ogre3d.org/
6 
7 Copyright (c) 2000-2013 Torus Knot Software Ltd
8 
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
15 
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 THE SOFTWARE.
26 -----------------------------------------------------------------------------
27 */
28 
29 #ifndef __OverlayProfileSessionListener_H__
30 #define __OverlayProfileSessionListener_H__
31 
33 #include "OgreProfiler.h"
34 #include "OgreOverlay.h"
35 
36 namespace Ogre {
37 
49  {
50  public:
53 
55  virtual void initializeSession();
56 
58  virtual void finializeSession();
59 
61  virtual void displayResults(const ProfileInstance& instance, ulong maxTotalFrameTime);
62 
64  virtual void changeEnableState(bool enabled);
65 
67  void setOverlayDimensions(Real width, Real height);
68 
70  void setOverlayPosition(Real left, Real top);
71 
76 
77  private:
79 
82  void displayResults(ProfileInstance* instance, ProfileBarList::const_iterator& bIter, Real& maxTimeMillisecs, Real& newGuiHeight, int& profileCount);
83 
86 
88  OverlayElement* createTextArea(const String& name, Real width, Real height, Real top, Real left,
89  uint fontSize, const String& caption, bool show = true);
90 
92  OverlayElement* createPanel(const String& name, Real width, Real height, Real top, Real left,
93  const String& materialName, bool show = true);
94 
97 
100 
103 
106 
109 
112 
115 
118 
121 
124 
127 
130 
133  };
134 }
135 #endif
Ogre::OverlayProfileSessionListener::mBarIndent
Real mBarIndent
The size of the indent for each profile display bar.
Definition: OgreOverlayProfileSessionListener.h:120
Ogre::OverlayProfileSessionListener::displayResults
virtual void displayResults(const ProfileInstance &instance, ulong maxTotalFrameTime)
Ogre::OverlayElement
Abstract definition of a 2D element to be displayed in an Overlay.
Definition: OgreOverlayElement.h:109
Ogre
Definition: OgreAndroidLogListener.h:35
Ogre::OverlayProfileSessionListener::createTextArea
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.
Ogre::OverlayProfileSessionListener::finializeSession
virtual void finializeSession()
OgreOverlayPrerequisites.h
Ogre::OverlayProfileSessionListener::setOverlayPosition
void setOverlayPosition(Real left, Real top)
Set the position of the profiler overlay, in pixels.
OgreOverlay.h
Ogre::OverlayProfileSessionListener::mMaxDisplayProfiles
uint mMaxDisplayProfiles
The max number of profiles we can display.
Definition: OgreOverlayProfileSessionListener.h:132
Ogre::OverlayProfileSessionListener::getOverlayLeft
Real getOverlayLeft() const
Ogre::OverlayProfileSessionListener::mGuiTop
Real mGuiTop
The vertical position of the stats window.
Definition: OgreOverlayProfileSessionListener.h:117
Ogre::OverlayProfileSessionListener::initializeSession
virtual void initializeSession()
Ogre::String
_StringBase String
Definition: OgrePrerequisites.h:439
Ogre::OverlayProfileSessionListener::OverlayProfileSessionListener
OverlayProfileSessionListener()
Ogre::OverlayProfileSessionListener::getOverlayWidth
Real getOverlayWidth() const
OgreProfiler.h
Ogre::ProfileInstance
Represents an individual profile call.
Definition: OgreProfiler.h:175
Ogre::OverlayProfileSessionListener::mGuiWidth
Real mGuiWidth
The width of the stats window.
Definition: OgreOverlayProfileSessionListener.h:111
Ogre::OverlayProfileSessionListener::mProfileBars
ProfileBarList mProfileBars
Holds the display bars for each profile results.
Definition: OgreOverlayProfileSessionListener.h:96
Ogre::OverlayProfileSessionListener::mBarHeight
Real mBarHeight
The height of each bar.
Definition: OgreOverlayProfileSessionListener.h:105
Ogre::list
Definition: OgrePrerequisites.h:506
Ogre::OverlayProfileSessionListener::displayResults
void displayResults(ProfileInstance *instance, ProfileBarList::const_iterator &bIter, Real &maxTimeMillisecs, Real &newGuiHeight, int &profileCount)
Prints the profiling results of each frame.
Ogre::OverlayProfileSessionListener
Concrete impl.
Definition: OgreOverlayProfileSessionListener.h:49
_OgreOverlayExport
#define _OgreOverlayExport
Definition: OgreOverlayPrerequisites.h:58
Ogre::OverlayProfileSessionListener::mBarSpacing
Real mBarSpacing
The distance between bars.
Definition: OgreOverlayProfileSessionListener.h:129
Ogre::OverlayProfileSessionListener::mBarLineWidth
Real mBarLineWidth
The width of the min, avg, and max lines in a profile display.
Definition: OgreOverlayProfileSessionListener.h:126
Ogre::OverlayProfileSessionListener::setOverlayDimensions
void setOverlayDimensions(Real width, Real height)
Set the size of the profiler overlay, in pixels.
Ogre::ProfileSessionListener
ProfileSessionListener should be used to visualize profile results.
Definition: OgreProfiler.h:230
Ogre::ulong
unsigned long ulong
Definition: OgrePrerequisites.h:115
Ogre::OverlayProfileSessionListener::createContainer
OverlayContainer * createContainer()
An internal function to create the container which will hold our display elements.
Ogre::OverlayProfileSessionListener::changeEnableState
virtual void changeEnableState(bool enabled)
Ogre::uint
unsigned int uint
Definition: OgrePrerequisites.h:114
Ogre::OverlayProfileSessionListener::getOverlayTop
Real getOverlayTop() const
Ogre::Real
float Real
Software floating point type.
Definition: OgrePrerequisites.h:70
Ogre::OverlayProfileSessionListener::getOverlayHeight
Real getOverlayHeight() const
Ogre::OverlayProfileSessionListener::mOverlay
Overlay * mOverlay
The overlay which contains our profiler results display.
Definition: OgreOverlayProfileSessionListener.h:99
Ogre::OverlayProfileSessionListener::createPanel
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.
Ogre::OverlayProfileSessionListener::mProfileGui
OverlayContainer * mProfileGui
The window that displays the profiler results.
Definition: OgreOverlayProfileSessionListener.h:102
Ogre::OverlayProfileSessionListener::mGuiLeft
Real mGuiLeft
The horz position of the stats window.
Definition: OgreOverlayProfileSessionListener.h:114
Ogre::OverlayProfileSessionListener::mGuiHeight
Real mGuiHeight
The height of the stats window.
Definition: OgreOverlayProfileSessionListener.h:108
Ogre::OverlayProfileSessionListener::~OverlayProfileSessionListener
virtual ~OverlayProfileSessionListener()
Ogre::OverlayProfileSessionListener::mGuiBorderWidth
Real mGuiBorderWidth
The width of the border between the profile window and each bar.
Definition: OgreOverlayProfileSessionListener.h:123
Ogre::OverlayProfileSessionListener::ProfileBarList
list< OverlayElement * >::type ProfileBarList
Definition: OgreOverlayProfileSessionListener.h:78
Ogre::Overlay
Represents a layer which is rendered on top of the 'normal' scene contents.
Definition: OgreOverlay.h:71
Ogre::OverlayContainer
A 2D element which contains other OverlayElement instances.
Definition: OgreOverlayContainer.h:57

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