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 
72  Real getOverlayWidth() const;
73  Real getOverlayHeight() const;
74  Real getOverlayLeft() const;
75  Real getOverlayTop() const;
76 
77  private:
79 
82  void displayResults(ProfileInstance* instance, ProfileBarList::const_iterator& bIter, Real& maxTimeMillisecs, Real& newGuiHeight, int& profileCount);
83 
85  OverlayContainer* createContainer();
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 
96  ProfileBarList mProfileBars;
97 
100 
103 
106 
109 
112 
115 
118 
121 
124 
127 
130 
133  };
134 }
135 #endif
unsigned int uint
uint mMaxDisplayProfiles
The max number of profiles we can display.
float Real
Software floating point type.
Represents an individual profile call.
Definition: OgreProfiler.h:174
#define _OgreOverlayExport
Real mGuiTop
The vertical position of the stats window.
Real mGuiWidth
The width of the stats window.
ProfileBarList mProfileBars
Holds the display bars for each profile results.
_StringBase String
Real mBarLineWidth
The width of the min, avg, and max lines in a profile display.
ProfileSessionListener should be used to visualize profile results.
Definition: OgreProfiler.h:229
unsigned long ulong
Overlay * mOverlay
The overlay which contains our profiler results display.
Abstract definition of a 2D element to be displayed in an Overlay.
Real mGuiLeft
The horz position of the stats window.
Real mGuiHeight
The height of the stats window.
A 2D element which contains other OverlayElement instances.
Represents a layer which is rendered on top of the 'normal' scene contents.
Definition: OgreOverlay.h:70
OverlayContainer * mProfileGui
The window that displays the profiler results.
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.

Copyright © 2012 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Mon Jan 2 2017 11:48:42