Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members |
#include <RenderTarget.h>
Classes | |
struct | FrameStats |
Public Member Functions | |
void | addRenderTargetEventReceiver (RenderTargetEventReceiver *newEventReceiver) |
virtual Viewport * | createViewport (Camera *cam, f32 left=0.0f, f32 top=0.0f, f32 width=1.0f, f32 height=1.0f) |
virtual f32 | getAverageFPS () const |
Individual stats access - gets the average frames per second (FPS) since call to RenderSystem::startRendering. | |
virtual f32 | getBestFPS () const |
Individual stats access - gets the best frames per second (FPS) since call to RenderSystem::startRendering. | |
virtual f32 | getBestFrameTime () const |
Individual stats access - gets the best frame time. | |
virtual u32 | getColorDepth () const |
virtual u32 | getHeight () const |
virtual f32 | getLastFPS () const |
Individual stats access - gets the number of frames per second (FPS) based on the last frame rendered. | |
virtual u32 | getPriority () const |
Gets the priority of a render target. | |
virtual const FrameStats & | getStatistics () const |
virtual s32 | getTriangleCount () const |
Gets the number of triangles rendered in the last update() call. | |
virtual Viewport * | getViewport (const u32 &id) |
Retrieves a pointer to a viewport by id. | |
std::map< u32, Viewport * > & | getViewports () |
virtual u32 | getWidth () const |
Retrieve information about the render target. | |
virtual f32 | getWorstFPS () const |
Individual stats access - gets the worst frames per second (FPS) since call to RenderSystem::startRendering. | |
virtual f32 | getWorstFrameTime () const |
Individual stats access - gets the worst frame time. | |
virtual bool | isActive () const |
Used to retrieve or set the active state of the render target. | |
virtual void | removeAllViewports () |
Removes all viewports on this target. | |
void | removeRenderTargetEventReceiver (RenderTargetEventReceiver *oldEventReceiver) |
virtual void | removeViewport (Viewport *vp) |
Removes a viewport from the rendering target. | |
virtual void | removeViewport (const u32 &id) |
Removes a viewport from the rendering target. | |
RenderTarget () | |
RenderTarget (const std::string &name) | |
virtual void | resetStatistics () |
Resets saved frame-rate statistices. | |
virtual void | setActive (bool state) |
Used to set the active state of the render target. | |
virtual void | setPriority (u32 priority) |
virtual | ~RenderTarget () |
Protected Member Functions | |
virtual void | firePostUpdate () |
internal method for firing events. | |
virtual void | firePreUpdate () |
internal method for firing events. | |
void | initProperties () |
virtual void | updateImpl (f32 elapsedTime) |
void | updateStats () |
Protected Attributes | |
bool | mActive |
bool | mAutoUpdate |
u32 | mColorDepth |
s32 | mFrameCount |
u32 | mHeight |
bool | mIsDepthBuffered |
u32 | mLastSecond |
u32 | mLastTime |
u32 | mPriority |
RenderTargetEvent * | mRenderTargetEvent |
std::list < RenderTargetEventReceiver * > | mRenderTargetEventReceivers |
FrameStats | mStats |
platform::Timer * | mTimer |
std::map< u32, Viewport * > | mViewports |
Central list of viewports - for easy memory management and lookup. | |
u32 | mWidth |
Static Protected Attributes | |
static u32 | msNextGeneratedRenderTargetIndex = 0 |
A 'canvas' which can receive the results of a rendering operation.
This abstract class defines a common root to all targets of rendering operations. A render target could be a window on a screen, or another off screen surface like a texture or bump map etc.
render::RenderTarget::RenderTarget | ( | ) |
References initProperties(), engine::Object::mObjectType, and engine::OT_RENDERTARGET.
render::RenderTarget::RenderTarget | ( | const std::string & | name | ) |
References initProperties(), engine::Object::mObjectType, and engine::OT_RENDERTARGET.
render::RenderTarget::~RenderTarget | ( | ) | [virtual] |
References mRenderTargetEvent, and removeAllViewports().
void render::RenderTarget::addRenderTargetEventReceiver | ( | RenderTargetEventReceiver * | newEventReceiver | ) |
References mRenderTargetEventReceivers.
Viewport * render::RenderTarget::createViewport | ( | Camera * | cam, |
f32 | left = 0.0f , |
||
f32 | top = 0.0f , |
||
f32 | width = 1.0f , |
||
f32 | height = 1.0f |
||
) | [virtual] |
Create a viewport to the rendering target.
A viewport is the rectangle into which redering output is sent. This method adds a viewport to the render target, rendering from the supplied camera. The rest of the parameters are only required if you wish to add more than one viewport to a single rendering target. Note that size information passed to this method is passed as a parametric, i.e. it is relative rather than absolute. This is to allow viewports to automatically resize along with the target.
cam,: | The camera from which the viewport contents will be rendered (mandatory) viewports i.e. picture-in-picture). Higher ZOrders are on top of lower ones. The actual number is irrelevant, only the relative ZOrder matters (you can leave gaps in the numbering) |
left,: | The relative position of the left of the viewport on the target, as a value between 0 and 1. |
top,: | The relative position of the top of the viewport on the target, as a value between 0 and 1. |
width,: | The relative width of the viewport on the target, as a value between 0 and 1. |
height,: | The relative height of the viewport on the target, as a value between 0 and 1. |
References engine::Object::getID(), and mViewports.
void render::RenderTarget::firePostUpdate | ( | ) | [protected, virtual] |
internal method for firing events.
References mRenderTargetEvent, mRenderTargetEventReceivers, and render::RenderTargetEvent::source.
Referenced by updateImpl().
void render::RenderTarget::firePreUpdate | ( | ) | [protected, virtual] |
internal method for firing events.
References mRenderTargetEvent, mRenderTargetEventReceivers, and render::RenderTargetEvent::source.
Referenced by updateImpl().
f32 render::RenderTarget::getAverageFPS | ( | ) | const [virtual] |
Individual stats access - gets the average frames per second (FPS) since call to RenderSystem::startRendering.
References render::RenderTarget::FrameStats::avgFPS, and mStats.
f32 render::RenderTarget::getBestFPS | ( | ) | const [virtual] |
Individual stats access - gets the best frames per second (FPS) since call to RenderSystem::startRendering.
References render::RenderTarget::FrameStats::bestFPS, and mStats.
f32 render::RenderTarget::getBestFrameTime | ( | ) | const [virtual] |
Individual stats access - gets the best frame time.
References render::RenderTarget::FrameStats::bestFrameTime, and mStats.
u32 render::RenderTarget::getColorDepth | ( | ) | const [virtual] |
References mColorDepth.
u32 render::RenderTarget::getHeight | ( | ) | const [virtual] |
References mHeight.
Referenced by render::Viewport::updateDimensions().
f32 render::RenderTarget::getLastFPS | ( | ) | const [virtual] |
Individual stats access - gets the number of frames per second (FPS) based on the last frame rendered.
References render::RenderTarget::FrameStats::lastFPS, and mStats.
u32 render::RenderTarget::getPriority | ( | ) | const [virtual] |
Gets the priority of a render target.
References mPriority.
const RenderTarget::FrameStats & render::RenderTarget::getStatistics | ( | ) | const [virtual] |
References mStats.
s32 render::RenderTarget::getTriangleCount | ( | ) | const [virtual] |
Gets the number of triangles rendered in the last update() call.
References mStats, and render::RenderTarget::FrameStats::triangleCount.
Retrieves a pointer to a viewport by id.
References mViewports.
References mViewports.
Referenced by render::RenderManager::updateImpl().
u32 render::RenderTarget::getWidth | ( | ) | const [virtual] |
Retrieve information about the render target.
References mWidth.
Referenced by render::Viewport::updateDimensions().
f32 render::RenderTarget::getWorstFPS | ( | ) | const [virtual] |
Individual stats access - gets the worst frames per second (FPS) since call to RenderSystem::startRendering.
References mStats, and render::RenderTarget::FrameStats::worstFPS.
f32 render::RenderTarget::getWorstFrameTime | ( | ) | const [virtual] |
Individual stats access - gets the worst frame time.
References mStats, and render::RenderTarget::FrameStats::worstFrameTime.
void render::RenderTarget::initProperties | ( | ) | [protected] |
References platform::PlatformManager::getInstance(), mRenderTargetEvent, mTimer, and resetStatistics().
Referenced by RenderTarget().
bool render::RenderTarget::isActive | ( | ) | const [virtual] |
Used to retrieve or set the active state of the render target.
Reimplemented in render::RenderWindow.
References mActive.
void render::RenderTarget::removeAllViewports | ( | ) | [virtual] |
void render::RenderTarget::removeRenderTargetEventReceiver | ( | RenderTargetEventReceiver * | oldEventReceiver | ) |
References mRenderTargetEventReceivers.
void render::RenderTarget::removeViewport | ( | Viewport * | vp | ) | [virtual] |
Removes a viewport from the rendering target.
References engine::Object::getID(), and mViewports.
void render::RenderTarget::removeViewport | ( | const u32 & | id | ) | [virtual] |
Removes a viewport from the rendering target.
References mViewports.
void render::RenderTarget::resetStatistics | ( | ) | [virtual] |
Resets saved frame-rate statistices.
References render::RenderTarget::FrameStats::avgFPS, render::RenderTarget::FrameStats::bestFPS, render::RenderTarget::FrameStats::bestFrameTime, platform::Timer::getMilliseconds(), render::RenderTarget::FrameStats::lastFPS, mFrameCount, mLastSecond, mLastTime, mStats, mTimer, render::RenderTarget::FrameStats::triangleCount, render::RenderTarget::FrameStats::worstFPS, and render::RenderTarget::FrameStats::worstFrameTime.
Referenced by initProperties().
void render::RenderTarget::setActive | ( | bool | state | ) | [virtual] |
Used to set the active state of the render target.
References mActive.
void render::RenderTarget::setPriority | ( | u32 | priority | ) | [virtual] |
Sets the priority of this render target in relation to the others.
This can be used in order to schedule render target updates. Lower priorities will be rendered first. Note that the priority must be set at the time the render target is attached to the render system, changes afterwards will not affect the ordering.
References mPriority.
void render::RenderTarget::updateImpl | ( | f32 | elapsedTime | ) | [protected, virtual] |
Reimplemented from engine::Object.
Reimplemented in render::RenderWindow.
References firePostUpdate(), firePreUpdate(), render::Viewport::getNumRenderedFaces(), render::Viewport::isVisible(), mStats, mViewports, render::RenderTarget::FrameStats::triangleCount, engine::Object::update(), and updateStats().
void render::RenderTarget::updateStats | ( | ) | [protected] |
References render::RenderTarget::FrameStats::avgFPS, render::RenderTarget::FrameStats::bestFPS, render::RenderTarget::FrameStats::bestFrameTime, platform::Timer::getMilliseconds(), render::RenderTarget::FrameStats::lastFPS, core::max(), mFrameCount, core::min(), mLastSecond, mLastTime, mStats, mTimer, render::RenderTarget::FrameStats::worstFPS, and render::RenderTarget::FrameStats::worstFrameTime.
Referenced by updateImpl().
bool render::RenderTarget::mActive [protected] |
Referenced by render::RenderWindow::isActive(), isActive(), and setActive().
bool render::RenderTarget::mAutoUpdate [protected] |
u32 render::RenderTarget::mColorDepth [protected] |
Referenced by getColorDepth(), and render::RenderWindow::getMetrics().
s32 render::RenderTarget::mFrameCount [protected] |
Referenced by resetStatistics(), and updateStats().
u32 render::RenderTarget::mHeight [protected] |
Referenced by getHeight(), and render::RenderWindow::getMetrics().
bool render::RenderTarget::mIsDepthBuffered [protected] |
u32 render::RenderTarget::mLastSecond [protected] |
Referenced by resetStatistics(), and updateStats().
u32 render::RenderTarget::mLastTime [protected] |
Referenced by resetStatistics(), and updateStats().
u32 render::RenderTarget::mPriority [protected] |
Referenced by getPriority(), and setPriority().
Referenced by firePostUpdate(), firePreUpdate(), initProperties(), and ~RenderTarget().
std::list<RenderTargetEventReceiver*> render::RenderTarget::mRenderTargetEventReceivers [protected] |
Referenced by addRenderTargetEventReceiver(), firePostUpdate(), firePreUpdate(), and removeRenderTargetEventReceiver().
u32 render::RenderTarget::msNextGeneratedRenderTargetIndex = 0 [static, protected] |
FrameStats render::RenderTarget::mStats [protected] |
platform::Timer* render::RenderTarget::mTimer [protected] |
Referenced by initProperties(), resetStatistics(), and updateStats().
std::map<u32, Viewport*> render::RenderTarget::mViewports [protected] |
Central list of viewports - for easy memory management and lookup.
Referenced by createViewport(), getViewport(), getViewports(), removeAllViewports(), removeViewport(), and updateImpl().
u32 render::RenderTarget::mWidth [protected] |
Referenced by render::RenderWindow::getMetrics(), and getWidth().
The KG Game Engine
Documentation © 2006-2011 by Kat'Oun. Generated on Sat Jul 2 2011 00:50:09 by
Doxygen
(1.7.4)
|