OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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-2014 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 
35 namespace Ogre {
36 
48  {
49  public:
52 
54  virtual void initializeSession();
55 
57  virtual void finializeSession();
58 
60  virtual void displayResults(const ProfileInstance& instance, ulong maxTotalFrameTime);
61 
63  virtual void changeEnableState(bool enabled);
64 
66  void setOverlayDimensions(Real width, Real height);
67 
69  void setOverlayPosition(Real left, Real top);
70 
71  Real getOverlayWidth() const;
72  Real getOverlayHeight() const;
73  Real getOverlayLeft() const;
74  Real getOverlayTop() const;
75 
76  private:
78 
81  void displayResults(ProfileInstance* instance, ProfileBarList::const_iterator& bIter, Real& maxTimeMillisecs, Real& newGuiHeight, int& profileCount);
82 
84  OverlayContainer* createContainer();
85 
87  OverlayElement* createTextArea(const String& name, Real width, Real height, Real top, Real left,
88  uint fontSize, const String& caption, bool show = true);
89 
91  OverlayElement* createPanel(const String& name, Real width, Real height, Real top, Real left,
92  const String& materialName, bool show = true);
93 
96 
99 
102 
105 
108 
111 
114 
117 
120 
123 
126 
129 
132  };
133 }
134 #endif
ProfileSessionListener should be used to visualize profile results.
Definition: OgreProfiler.h:228
Real mBarIndent
The size of the indent for each profile display bar.
float Real
Software floating point type.
ProfileBarList mProfileBars
Holds the display bars for each profile results.
unsigned long ulong
Overlay * mOverlay
The overlay which contains our profiler results display.
#define _OgreOverlayExport
Real mBarLineWidth
The width of the min, avg, and max lines in a profile display.
A 2D element which contains other OverlayElement instances.
Represents an individual profile call.
Definition: OgreProfiler.h:173
Real mGuiWidth
The width of the stats window.
Real mGuiLeft
The horz position of the stats window.
OverlayContainer * mProfileGui
The window that displays the profiler results.
Abstract definition of a 2D element to be displayed in an Overlay.
uint mMaxDisplayProfiles
The max number of profiles we can display.
_StringBase String
Definition: OgreCommon.h:53
Real mGuiHeight
The height of the stats window.
Real mGuiTop
The vertical position of the stats window.
Represents a layer which is rendered on top of the 'normal' scene contents.
Definition: OgreOverlay.h:69
unsigned int uint
Real mGuiBorderWidth
The width of the border between the profile window and each bar.