28 #ifndef __RenderTarget_H__
29 #define __RenderTarget_H__
39 #ifndef OGRE_NUM_RENDERTARGET_GROUPS
40 #define OGRE_NUM_RENDERTARGET_GROUPS 10
41 #define OGRE_DEFAULT_RT_GROUP 4
42 #define OGRE_REND_TO_TEX_RT_GROUP 2
74 SF_TRIANGLE_COUNT = 16,
101 virtual const String& getName(
void)
const;
104 virtual void getMetrics(
unsigned int& width,
unsigned int& height,
unsigned int& colourDepth);
106 virtual unsigned int getWidth(
void)
const;
107 virtual unsigned int getHeight(
void)
const;
108 virtual unsigned int getColourDepth(
void)
const;
132 virtual void update(
bool swapBuffers =
true);
154 { (void)waitForVSync; }
179 virtual Viewport* addViewport(
Camera* cam,
int ZOrder = 0,
float left = 0.0f,
float top = 0.0f ,
180 float width = 1.0f,
float height = 1.0f);
183 virtual unsigned short getNumViewports(
void)
const;
186 virtual Viewport* getViewport(
unsigned short index);
190 virtual void removeViewport(
int ZOrder);
194 virtual void removeAllViewports(
void);
214 virtual void getStatistics(
float& lastFPS,
float& avgFPS,
215 float& bestFPS,
float& worstFPS)
const;
217 virtual const FrameStats& getStatistics(
void)
const;
221 virtual float getLastFPS()
const;
225 virtual float getAverageFPS()
const;
229 virtual float getBestFPS()
const;
233 virtual float getWorstFPS()
const;
237 virtual float getBestFrameTime()
const;
241 virtual float getWorstFrameTime()
const;
245 virtual void resetStatistics(
void);
256 virtual void getCustomAttribute(
const String& name,
void* pData);
270 virtual void removeAllListeners(
void);
285 virtual bool isActive()
const;
289 virtual void setActive(
bool state );
302 virtual void setAutoUpdated(
bool autoupdate);
306 virtual bool isAutoUpdated(
void)
const;
313 virtual void copyContentsToMemory(
const PixelBox &dst, FrameBuffer buffer = FB_AUTO) = 0;
321 void writeContentsToFile(
const String& filename);
325 virtual String writeContentsToTimestampedFile(
const String& filenamePrefix,
const String& filenameSuffix);
327 virtual bool requiresTextureFlipping()
const = 0;
330 virtual size_t getTriangleCount(
void)
const;
332 virtual size_t getBatchCount(
void)
const;
336 virtual void _notifyCameraRemoved(
const Camera* cam);
344 virtual bool isPrimary(
void)
const;
376 virtual Impl *_getImpl();
401 virtual void _beginUpdate();
412 virtual void _updateViewport(
int zorder,
bool updateStatistics =
true);
422 virtual void _updateViewport(
Viewport* viewport,
bool updateStatistics =
true);
432 virtual void _updateAutoUpdatedViewports(
bool updateStatistics =
true);
440 virtual void _endUpdate();
469 void updateStats(
void);
480 virtual void firePreUpdate(
void);
482 virtual void firePostUpdate(
void);
484 virtual void fireViewportPreUpdate(
Viewport* vp);
486 virtual void fireViewportPostUpdate(
Viewport* vp);
488 virtual void fireViewportAdded(
Viewport* vp);
490 virtual void fireViewportRemoved(
Viewport* vp);
493 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.
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...
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.
unsigned int mColourDepth
virtual void swapBuffers(bool waitForVSync=true)
Swaps the frame buffers to display the next frame.
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...
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.
unsigned long bestFrameTime
unsigned long mLastSecond
A primitive describing a volume (3D), image (2D) or line (1D) of pixels in memory.