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,
102 virtual const String& getName(
void)
const;
105 virtual void getMetrics(
unsigned int& width,
unsigned int& height,
unsigned int& colourDepth);
107 virtual uint32 getWidth(
void)
const;
108 virtual uint32 getHeight(
void)
const;
109 virtual uint32 getColourDepth(
void)
const;
118 void setDepthBufferPool(
uint16 poolId );
121 uint16 getDepthBufferPool()
const;
126 virtual bool attachDepthBuffer(
DepthBuffer *depthBuffer );
128 virtual void detachDepthBuffer();
134 virtual void _detachDepthBuffer();
158 virtual void update(
bool swapBuffers =
true);
192 virtual Viewport* addViewport(
Camera* cam,
int ZOrder = 0,
float left = 0.0f,
float top = 0.0f ,
193 float width = 1.0f,
float height = 1.0f);
196 virtual unsigned short getNumViewports(
void)
const;
199 virtual Viewport* getViewport(
unsigned short index);
204 virtual Viewport* getViewportByZOrder(
int ZOrder);
207 virtual bool hasViewportWithZOrder(
int ZOrder);
211 virtual void removeViewport(
int ZOrder);
215 virtual void removeAllViewports(
void);
235 virtual void getStatistics(
float& lastFPS,
float& avgFPS,
236 float& bestFPS,
float& worstFPS)
const;
238 virtual const FrameStats& getStatistics(
void)
const;
242 virtual float getLastFPS()
const;
246 virtual float getAverageFPS()
const;
250 virtual float getBestFPS()
const;
254 virtual float getWorstFPS()
const;
258 virtual float getBestFrameTime()
const;
262 virtual float getWorstFrameTime()
const;
266 virtual void resetStatistics(
void);
277 virtual void getCustomAttribute(
const String& name,
void* pData);
291 virtual void removeAllListeners(
void);
306 virtual bool isActive()
const;
310 virtual void setActive(
bool state );
323 virtual void setAutoUpdated(
bool autoupdate);
327 virtual bool isAutoUpdated(
void)
const;
334 virtual void copyContentsToMemory(
const PixelBox &dst, FrameBuffer buffer = FB_AUTO) = 0;
342 void writeContentsToFile(
const String& filename);
346 virtual String writeContentsToTimestampedFile(
const String& filenamePrefix,
const String& filenameSuffix);
348 virtual bool requiresTextureFlipping()
const = 0;
351 virtual size_t getTriangleCount(
void)
const;
353 virtual size_t getBatchCount(
void)
const;
357 virtual void _notifyCameraRemoved(
const Camera* cam);
365 virtual bool isPrimary(
void)
const;
397 virtual Impl *_getImpl();
422 virtual void _beginUpdate();
433 virtual void _updateViewport(
int zorder,
bool updateStatistics =
true);
443 virtual void _updateViewport(
Viewport* viewport,
bool updateStatistics =
true);
453 virtual void _updateAutoUpdatedViewports(
bool updateStatistics =
true);
461 virtual void _endUpdate();
491 void updateStats(
void);
502 virtual void firePreUpdate(
void);
504 virtual void firePostUpdate(
void);
506 virtual void fireViewportPreUpdate(
Viewport* vp);
508 virtual void fireViewportPostUpdate(
Viewport* vp);
510 virtual void fireViewportAdded(
Viewport* vp);
512 virtual void fireViewportRemoved(
Viewport* vp);
515 virtual void updateImpl();
A 'canvas' which can receive the results of a rendering operation.
A viewpoint from which the scene will be rendered.
vector< RenderTargetListener * >::type RenderTargetListenerList
virtual uint getFSAA() const
Indicates whether multisampling is performed on rendering and at what level.
uint16 mDepthBufferPoolId
map< int, Viewport * >::type ViewportList
virtual PixelFormat suggestPixelFormat() const
Suggests a pixel format to use for extracting the data in this target, when calling copyContentsToMem...
virtual uchar getPriority() const
Gets the priority of a render target.
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...
An abstract class that contains a depth/stencil buffer.
String mName
The name of this target.
RenderSystem specific interface for a RenderTarget; this should be subclassed by RenderSystems.
uchar mPriority
The priority of the render target.
PixelFormat
The pixel format used for images, textures, and render surfaces.
unsigned char uchar
In order to avoid finger-aches :)
unsigned long worstFrameTime
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
DepthBuffer * mDepthBuffer
RenderTargetListenerList mListeners
A interface class defining a listener which can be used to receive notifications of RenderTarget even...
ViewportList mViewportList
List of viewports, map on Z-order.
virtual void setPriority(uchar priority)
Sets the priority of this render target in relation to the others.
virtual const String & getFSAAHint() const
Gets the FSAA hint (.
An abstraction of a viewport, i.e.
virtual void swapBuffers()
Swaps the frame buffers to display the next frame.
unsigned long bestFrameTime
unsigned long mLastSecond
A primitive describing a volume (3D), image (2D) or line (1D) of pixels in memory.