Go to the documentation of this file.
28 #ifndef __RenderTarget_H__
29 #define __RenderTarget_H__
40 #ifndef OGRE_NUM_RENDERTARGET_GROUPS
41 #define OGRE_NUM_RENDERTARGET_GROUPS 10
42 #define OGRE_DEFAULT_RT_GROUP 4
43 #define OGRE_REND_TO_TEX_RT_GROUP 2
75 SF_TRIANGLE_COUNT = 16,
105 virtual void getMetrics(
unsigned int& width,
unsigned int& height,
unsigned int& colourDepth);
158 virtual void update(
bool swapBuffers =
true);
193 float width = 1.0f,
float height = 1.0f);
236 float& bestFPS,
float& worstFPS)
const;
virtual uint32 getHeight(void) const
virtual void getStatistics(float &lastFPS, float &avgFPS, float &bestFPS, float &worstFPS) const
Retieves details of current rendering performance.
RenderTargetListenerList mListeners
ViewportList mViewportList
List of viewports, map on Z-order.
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
virtual bool isPrimary(void) const
Indicates whether this target is the primary window.
virtual uint32 getWidth(void) const
virtual void getCustomAttribute(const String &name, void *pData)
Gets a custom (maybe platform-specific) attribute.
An abstract class that contains a depth/stencil buffer.
unsigned long worstFrameTime
virtual bool isActive() const
Used to retrieve or set the active state of the render target.
virtual float getWorstFPS() const
Individual stats access - gets the worst frames per second (FPS) since call to Root::startRendering.
A viewpoint from which the scene will be rendered.
virtual const String & getFSAAHint() const
Gets the FSAA hint (.
virtual bool attachDepthBuffer(DepthBuffer *depthBuffer)
uint16 getDepthBufferPool() const
virtual void fireViewportPostUpdate(Viewport *vp)
internal method for firing events
@ PF_BYTE_RGBA
4 byte pixel format, 1 byte for red, 1 byte for green, 1 byte for blue, and one byte for alpha
virtual bool isHardwareGammaEnabled() const
Indicates whether on rendering, linear colour space is converted to sRGB gamma colour space.
virtual void addListener(RenderTargetListener *listener)
Add a listener to this RenderTarget which will be called back before & after rendering.
virtual void removeAllListeners(void)
Removes all listeners from this instance.
virtual bool isAutoUpdated(void) const
Gets whether this target is automatically updated if Ogre's rendering loop or Root::_updateAllRenderT...
virtual void removeViewport(int ZOrder)
Removes a viewport at a given Z-order.
virtual size_t getTriangleCount(void) const
Gets the number of triangles rendered in the last update() call.
virtual void getMetrics(unsigned int &width, unsigned int &height, unsigned int &colourDepth)
Retrieve information about the render target.
virtual void copyContentsToMemory(const PixelBox &dst, FrameBuffer buffer=FB_AUTO)=0
Copies the current contents of the render target to a pixelbox.
virtual Viewport * getViewportByZOrder(int ZOrder)
Retrieves a pointer to the viewport with the given Z-order.
String mName
The name of this target.
virtual void _updateAutoUpdatedViewports(bool updateStatistics=true)
Method for manual management of rendering - renders only viewports that are auto updated.
virtual Impl * _getImpl()
Get rendersystem specific interface for this RenderTarget.
virtual void setActive(bool state)
Used to set the active state of the render target.
virtual bool requiresTextureFlipping() const =0
virtual uint getFSAA() const
Indicates whether multisampling is performed on rendering and at what level.
A interface class defining a listener which can be used to receive notifications of RenderTarget even...
virtual size_t getBatchCount(void) const
Gets the number of batches rendered in the last update() call.
A 'canvas' which can receive the results of a rendering operation.
void writeContentsToFile(const String &filename)
Writes the current contents of the render target to the named file.
PixelFormat
The pixel format used for images, textures, and render surfaces.
virtual void _beginUpdate()
Method for manual management of rendering : fires 'preRenderTargetUpdate' and initialises statistics ...
vector< RenderTargetListener * >::type RenderTargetListenerList
An abstraction of a viewport, i.e.
uint16 mDepthBufferPoolId
unsigned long mLastSecond
unsigned char uchar
In order to avoid finger-aches :)
virtual void firePreUpdate(void)
internal method for firing events
virtual float getLastFPS() const
Individual stats access - gets the number of frames per second (FPS) based on the last frame rendered...
virtual void setAutoUpdated(bool autoupdate)
Sets whether this target should be automatically updated if Ogre's rendering loop or Root::_updateAll...
map< int, Viewport * >::type ViewportList
virtual void removeAllViewports(void)
Removes all viewports on this target.
virtual void update(bool swapBuffers=true)
Tells the target to update it's contents.
virtual bool hasViewportWithZOrder(int ZOrder)
Returns true if and only if a viewport exists at the given Z-order.
virtual void removeListener(RenderTargetListener *listener)
Removes a RenderTargetListener previously registered using addListener.
virtual void fireViewportRemoved(Viewport *vp)
internal method for firing events
virtual float getBestFPS() const
Individual stats access - gets the best frames per second (FPS) since call to Root::startRendering.
virtual const FrameStats & getStatistics(void) const
DepthBuffer * mDepthBuffer
virtual uchar getPriority() const
Gets the priority of a render target.
virtual Viewport * addViewport(Camera *cam, int ZOrder=0, float left=0.0f, float top=0.0f, float width=1.0f, float height=1.0f)
Adds a viewport to the rendering target.
virtual void _updateViewport(Viewport *viewport, bool updateStatistics=true)
Method for manual management of rendering - renders the given viewport (even if it is not autoupdated...
virtual void firePostUpdate(void)
internal method for firing events
virtual void _endUpdate()
Method for manual management of rendering - finishes statistics calculation and fires 'postRenderTarg...
void setDepthBufferPool(uint16 poolId)
Sets the pool ID this RenderTarget should query from.
A primitive describing a volume (3D), image (2D) or line (1D) of pixels in memory.
virtual void _updateViewport(int zorder, bool updateStatistics=true)
Method for manual management of rendering - renders the given viewport (even if it is not autoupdated...
virtual float getAverageFPS() const
Individual stats access - gets the average frames per second (FPS) since call to Root::startRendering...
RenderSystem specific interface for a RenderTarget; this should be subclassed by RenderSystems.
virtual void _detachDepthBuffer()
Detaches DepthBuffer without notifying it from the detach.
uchar mPriority
The priority of the render target.
virtual void setPriority(uchar priority)
Sets the priority of this render target in relation to the others.
virtual void fireViewportPreUpdate(Viewport *vp)
internal method for firing events
virtual const String & getName(void) const
Retrieve target's name.
virtual void resetStatistics(void)
Resets saved frame-rate statistices.
unsigned long bestFrameTime
virtual Viewport * getViewport(unsigned short index)
Retrieves a pointer to the viewport with the given index.
virtual float getWorstFrameTime() const
Individual stats access - gets the worst frame time.
DepthBuffer * getDepthBuffer() const
virtual float getBestFrameTime() const
Individual stats access - gets the best frame time.
virtual void detachDepthBuffer()
virtual void fireViewportAdded(Viewport *vp)
internal method for firing events
virtual void _notifyCameraRemoved(const Camera *cam)
Utility method to notify a render target that a camera has been removed, incase it was referring to i...
virtual void updateImpl()
Internal implementation of update()
virtual PixelFormat suggestPixelFormat() const
Suggests a pixel format to use for extracting the data in this target, when calling copyContentsToMem...
virtual String writeContentsToTimestampedFile(const String &filenamePrefix, const String &filenameSuffix)
Writes the current contents of the render target to the (PREFIX)(time-stamp)(SUFFIX) file.
virtual void swapBuffers()
Swaps the frame buffers to display the next frame.
virtual unsigned short getNumViewports(void) const
Returns the number of viewports attached to this target.
virtual uint32 getColourDepth(void) const
Copyright © 2012 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.