OgreOverlayProfileSessionListener.h
Go to the documentation of this file.
1/*
2-----------------------------------------------------------------------------
3This source file is part of OGRE
4 (Object-oriented Graphics Rendering Engine)
5For the latest info, see http://www.ogre3d.org/
6
7Copyright (c) 2000-2013 Torus Knot Software Ltd
8
9Permission is hereby granted, free of charge, to any person obtaining a copy
10of this software and associated documentation files (the "Software"), to deal
11in the Software without restriction, including without limitation the rights
12to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13copies of the Software, and to permit persons to whom the Software is
14furnished to do so, subject to the following conditions:
15
16The above copyright notice and this permission notice shall be included in
17all copies or substantial portions of the Software.
18
19THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25THE SOFTWARE.
26-----------------------------------------------------------------------------
27*/
28
29#ifndef __OverlayProfileSessionListener_H__
30#define __OverlayProfileSessionListener_H__
31
33#include "OgreProfiler.h"
34#include "OgreOverlay.h"
35
36namespace 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
#define _OgreOverlayExport
A 2D element which contains other OverlayElement instances.
Abstract definition of a 2D element to be displayed in an Overlay.
Represents a layer which is rendered on top of the 'normal' scene contents.
Definition: OgreOverlay.h:71
Represents an individual profile call.
Definition: OgreProfiler.h:175
ProfileSessionListener should be used to visualize profile results.
Definition: OgreProfiler.h:230
OverlayContainer * mProfileGui
The window that displays the profiler results.
Real mGuiTop
The vertical position of the stats window.
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.
virtual void changeEnableState(bool enabled)
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.
ProfileBarList mProfileBars
Holds the display bars for each profile results.
Real mGuiLeft
The horz position of the stats window.
virtual void displayResults(const ProfileInstance &instance, ulong maxTotalFrameTime)
uint mMaxDisplayProfiles
The max number of profiles we can display.
Real mBarLineWidth
The width of the min, avg, and max lines in a profile display.
Overlay * mOverlay
The overlay which contains our profiler results display.
OverlayContainer * createContainer()
An internal function to create the container which will hold our display elements.
void displayResults(ProfileInstance *instance, ProfileBarList::const_iterator &bIter, Real &maxTimeMillisecs, Real &newGuiHeight, int &profileCount)
Prints the profiling results of each frame.
Real mGuiHeight
The height of the stats window.
Real mBarIndent
The size of the indent for each profile display bar.
void setOverlayPosition(Real left, Real top)
Set the position of the profiler overlay, in pixels.
void setOverlayDimensions(Real width, Real height)
Set the size of the profiler overlay, in pixels.
Real mGuiBorderWidth
The width of the border between the profile window and each bar.
unsigned long ulong
float Real
Software floating point type.
unsigned int uint
_StringBase String

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