OgreFrameListener.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 __FrameListener_H__
#define __FrameListener_H__
#include "OgrePrerequisites.h"
namespace Ogre {
struct FrameEvent
{
Real timeSinceLastEvent;
Real timeSinceLastFrame;
};
class _OgreExport FrameListener
{
/*
Note that this could have been an abstract class, but I made
the explicit choice not to do this, because I wanted to give
people the option of only implementing the methods they wanted,
rather than having to create 'do nothing' implementations for
those they weren't interested in. As such this class follows
the 'Adapter' classes in Java rather than pure interfaces.
*/
public:
virtual bool frameStarted(const FrameEvent& evt)
{ (void)evt; return true; }
virtual bool frameRenderingQueued(const FrameEvent& evt)
{ (void)evt; return true; }
virtual bool frameEnded(const FrameEvent& evt)
{ (void)evt; return true; }
virtual ~FrameListener() {}
};
}
#endif
Ogre::FrameListener::frameStarted
virtual bool frameStarted(const FrameEvent &evt)
Called when a frame is about to begin rendering.
Definition: OgreFrameListener.h:97
_OgreExport
#define _OgreExport
Definition: OgrePlatform.h:257
Ogre::Real
float Real
Software floating point type.
Definition: OgrePrerequisites.h:70
Ogre::FrameEvent::timeSinceLastFrame
Real timeSinceLastFrame
Elapsed time in seconds since the last event of the same type, i.e.
Definition: OgreFrameListener.h:60
OgrePrerequisites.h
Ogre::FrameListener::frameRenderingQueued
virtual bool frameRenderingQueued(const FrameEvent &evt)
Called after all render targets have had their rendering commands issued, but before render windows h...
Definition: OgreFrameListener.h:116
Ogre::FrameEvent
Struct containing information about a frame event.
Definition: OgreFrameListener.h:44
Ogre::FrameListener::~FrameListener
virtual ~FrameListener()
Definition: OgreFrameListener.h:130
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::FrameListener::frameEnded
virtual bool frameEnded(const FrameEvent &evt)
Called just after a frame has been rendered.
Definition: OgreFrameListener.h:127
Ogre::FrameEvent::timeSinceLastEvent
Real timeSinceLastEvent
Elapsed time in seconds since the last event.
Definition: OgreFrameListener.h:53
Ogre::FrameListener
A interface class defining a listener which can be used to receive notifications of frame events...
Definition: OgreFrameListener.h:79

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