OgreOverlayProfileSessionListener.h
Go to the documentation of this file.
/*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/
Copyright (c) 2000-2013 Torus Knot Software Ltd
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-----------------------------------------------------------------------------
*/
#ifndef __OverlayProfileSessionListener_H__
#define __OverlayProfileSessionListener_H__
#include "OgreOverlayPrerequisites.h"
#include "OgreProfiler.h"
#include "OgreOverlay.h"
namespace Ogre {
class _OgreOverlayExport OverlayProfileSessionListener : public ProfileSessionListener
{
public:
OverlayProfileSessionListener();
virtual ~OverlayProfileSessionListener();
virtual void initializeSession();
virtual void finializeSession();
virtual void displayResults(const ProfileInstance& instance, ulong maxTotalFrameTime);
virtual void changeEnableState(bool enabled);
void setOverlayDimensions(Real width, Real height);
void setOverlayPosition(Real left, Real top);
Real getOverlayWidth() const;
Real getOverlayHeight() const;
Real getOverlayLeft() const;
Real getOverlayTop() const;
private:
typedef list<OverlayElement*>::type ProfileBarList;
void displayResults(ProfileInstance* instance, ProfileBarList::const_iterator& bIter, Real& maxTimeMillisecs, Real& newGuiHeight, int& profileCount);
OverlayContainer* createContainer();
OverlayElement* createTextArea(const String& name, Real width, Real height, Real top, Real left,
uint fontSize, const String& caption, bool show = true);
OverlayElement* createPanel(const String& name, Real width, Real height, Real top, Real left,
const String& materialName, bool show = true);
ProfileBarList mProfileBars;
Overlay* mOverlay;
OverlayContainer* mProfileGui;
Real mBarHeight;
Real mGuiHeight;
Real mGuiWidth;
Real mGuiLeft;
Real mGuiTop;
Real mBarIndent;
Real mGuiBorderWidth;
Real mBarLineWidth;
Real mBarSpacing;
uint mMaxDisplayProfiles;
};
}
#endif
OgreProfiler.h
Ogre::list
Definition: OgrePrerequisites.h:505
Ogre::uint
unsigned int uint
Definition: OgrePrerequisites.h:114
OgreOverlay.h
Ogre::OverlayProfileSessionListener::mMaxDisplayProfiles
uint mMaxDisplayProfiles
The max number of profiles we can display.
Definition: OgreOverlayProfileSessionListener.h:132
Ogre::Real
float Real
Software floating point type.
Definition: OgrePrerequisites.h:70
Ogre::ProfileInstance
Represents an individual profile call.
Definition: OgreProfiler.h:174
_OgreOverlayExport
#define _OgreOverlayExport
Definition: OgreOverlayPrerequisites.h:58
Ogre::OverlayProfileSessionListener::mGuiTop
Real mGuiTop
The vertical position of the stats window.
Definition: OgreOverlayProfileSessionListener.h:117
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::OverlayProfileSessionListener::mBarSpacing
Real mBarSpacing
The distance between bars.
Definition: OgreOverlayProfileSessionListener.h:129
Ogre::String
_StringBase String
Definition: OgrePrerequisites.h:439
OgreOverlayPrerequisites.h
Ogre::OverlayProfileSessionListener
Concrete impl.
Definition: OgreOverlayProfileSessionListener.h:48
Ogre::OverlayProfileSessionListener::mBarLineWidth
Real mBarLineWidth
The width of the min, avg, and max lines in a profile display.
Definition: OgreOverlayProfileSessionListener.h:126
Ogre::ProfileSessionListener
ProfileSessionListener should be used to visualize profile results.
Definition: OgreProfiler.h:229
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::ulong
unsigned long ulong
Definition: OgrePrerequisites.h:115
Ogre::OverlayProfileSessionListener::mOverlay
Overlay * mOverlay
The overlay which contains our profiler results display.
Definition: OgreOverlayProfileSessionListener.h:99
Ogre::OverlayElement
Abstract definition of a 2D element to be displayed in an Overlay.
Definition: OgreOverlayElement.h:108
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::OverlayContainer
A 2D element which contains other OverlayElement instances.
Definition: OgreOverlayContainer.h:56
Ogre::Overlay
Represents a layer which is rendered on top of the &#39;normal&#39; scene contents.
Definition: OgreOverlay.h:70
Ogre::OverlayProfileSessionListener::mProfileGui
OverlayContainer * mProfileGui
The window that displays the profiler results.
Definition: OgreOverlayProfileSessionListener.h:102
Ogre::OverlayProfileSessionListener::mBarIndent
Real mBarIndent
The size of the indent for each profile display bar.
Definition: OgreOverlayProfileSessionListener.h:120
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

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