Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Ogre::D3D8RenderTexture Class Reference

#include <OgreD3D8Texture.h>

Inheritance diagram for Ogre::D3D8RenderTexture:

Ogre::RenderTexture Ogre::RenderTarget List of all members.

Public Types

enum  StatFlags {
  SF_NONE = 0, SF_FPS = 1, SF_AVG_FPS = 2, SF_BEST_FPS = 4,
  SF_WORST_FPS = 8, SF_TRIANGLE_COUNT = 16, SF_ALL = 0xFFFF
}

Public Methods

 D3D8RenderTexture (const String &name, uint width, uint height)
virtual void getCustomAttribute (String name, void *pData)
 Gets a custom (maybe platform-specific) attribute. More...

bool requiresTextureFlipping () const
virtual void writeContentsToFile (const String &filename)
 Writes the current contents of the render target to the named file. More...

virtual void outputText (int x, int y, const String &text)
 DEPRECATED Outputs text to the target at the specified co-ordinates. More...

virtual String getName (void)
 Retrieve target's name. More...

virtual void getMetrics (int &width, int &height, int &colourDepth)
 Retrieve information about the render target. More...

virtual int getWidth (void)
virtual int getHeight (void)
virtual int getColourDepth (void)
virtual void update (void)
 Tells the target to update it's contents. More...

virtual ViewportaddViewport (Camera *cam, int ZOrder=0, float left=0, float top=0, float width=100, float height=100)
 Adds a viewport to the rendering target. More...

virtual unsigned short getNumViewports (void)
 Returns the number of viewports attached to this target. More...

virtual ViewportgetViewport (unsigned short index)
 Retrieves a pointer to the viewport with the given index. More...

virtual void removeViewport (int ZOrder)
 Removes a viewport at a given ZOrder. More...

virtual void removeAllViewports (void)
 Removes all viewports on this target. More...

virtual void setStatsDisplay (StatFlags sf)
 DEPRECATED Set what kind of statistics display (if any) should be displayed by the system about this target. More...

virtual void getStatistics (float &lastFPS, float &avgFPS, float &bestFPS, float &worstFPS)
 Retieves details of current rendering performance. More...

virtual float getLastFPS ()
 Individual stats access - gets the number of frames per second (FPS) based on the last frame rendered. More...

virtual float getAverageFPS ()
 Individual stats access - gets the average frames per second (FPS) since call to RenderSystem::startRendering. More...

virtual float getBestFPS ()
 Individual stats access - gets the best frames per second (FPS) since call to RenderSystem::startRendering. More...

virtual float getWorstFPS ()
 Individual stats access - gets the worst frames per second (FPS) since call to RenderSystem::startRendering. More...

virtual void resetStatistics (void)
 Resets saved frame-rate statistices. More...

virtual void setDebugText (const String &text)
 Adds debug text to this window. More...

const StringRenderTarget::getDebugText () const
 Returns the debug text. More...

virtual void addListener (RenderTargetListener *listener)
 Add a listener to this RenderTarget which will be called back before & after rendering. More...

virtual void removeListener (RenderTargetListener *listener)
 Removes a RenderTargetListener previously registered using addListener. More...

virtual void removeAllListeners (void)
 Removes all listeners from this instance. More...

virtual void setPriority (uchar priority)
 Sets the priority of this render target in relation to the others. More...

virtual uchar getPriority () const
 Gets the priority of a render target. More...

virtual bool isActive () const
 Used to retrieve or set the active state of the render target. More...

virtual void setActive (bool state)
 Used to retrieve the active state of the render target. More...


Protected Types

typedef std::map< int, Viewport *,
std::less< int > > 
ViewportList
typedef std::vector< RenderTargetListener * > RenderTargetListenerList

Protected Methods

virtual void firePostUpdate ()
 internal method for firing events. More...

void updateStats (void)
virtual void firePreUpdate (void)
 internal method for firing events. More...


Protected Attributes

TexturemTexture
 The texture that gets accesses by the rest of the API. More...

TexturemPrivateTex
 The texture to which rendering takes place. More...

String mName
 The name of this target. More...

uchar mPriority
 The priority of the render target. More...

int mWidth
int mHeight
int mColourDepth
bool mIsDepthBuffered
StatFlags mStatFlags
float mLastFPS
float mAvgFPS
float mBestFPS
float mWorstFPS
unsigned int mTris
String mDebugText
bool mActive
ViewportList mViewportList
 List of viewports, map on Z-order. More...

RenderTargetListenerList mListeners

Member Typedef Documentation

typedef std::vector<RenderTargetListener*> Ogre::RenderTarget::RenderTargetListenerList [protected, inherited]
 

typedef std::map<int, Viewport*, std::less<int> > Ogre::RenderTarget::ViewportList [protected, inherited]
 


Member Enumeration Documentation

enum Ogre::RenderTarget::StatFlags [inherited]
 

Enumeration values:
SF_NONE 
SF_FPS 
SF_AVG_FPS 
SF_BEST_FPS 
SF_WORST_FPS 
SF_TRIANGLE_COUNT 
SF_ALL 


Constructor & Destructor Documentation

Ogre::D3D8RenderTexture::D3D8RenderTexture const String   name,
uint    width,
uint    height
[inline]
 


Member Function Documentation

void Ogre::RenderTarget::addListener RenderTargetListener   listener [virtual, inherited]
 

Add a listener to this RenderTarget which will be called back before & after rendering.

Remarks:
If you want notifications before and after a target is updated by the system, use this method to register your own custom RenderTargetListener class. This is useful for potentially adding your own manual rendering commands before and after the 'normal' system rendering.
NB this should not be used for frame-based scene updates, use Root::addFrameListener for that.

Viewport * Ogre::RenderTarget::addViewport Camera   cam,
int    ZOrder = 0,
float    left = 0,
float    top = 0,
float    width = 100,
float    height = 100
[virtual, inherited]
 

Adds a viewport to the rendering target.

Remarks:
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 percentage, i.e. it is relative rather than absolute. This is to allow viewports to automatically resize along with the target.
Parameters:
cam  The camera from which the viewport contents will be rendered (mandatory)
ZOrder  The relative order of the viewport with others on the target (allows overlapping 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 percentage.
top  The relative position of the top of the viewport on the target, as a percentage.
width  The relative width of the viewport on the target, as a percentage.
height  The relative height of the viewport on the target, as a percentage.

void Ogre::RenderTexture::firePostUpdate   [protected, virtual, inherited]
 

internal method for firing events.

Reimplemented from Ogre::RenderTarget.

void Ogre::RenderTarget::firePreUpdate void    [protected, virtual, inherited]
 

internal method for firing events.

float Ogre::RenderTarget::getAverageFPS   [virtual, inherited]
 

Individual stats access - gets the average frames per second (FPS) since call to RenderSystem::startRendering.

float Ogre::RenderTarget::getBestFPS   [virtual, inherited]
 

Individual stats access - gets the best frames per second (FPS) since call to RenderSystem::startRendering.

int Ogre::RenderTarget::getColourDepth void    [virtual, inherited]
 

virtual void Ogre::D3D8RenderTexture::getCustomAttribute String    name,
void *    pData
[inline, virtual]
 

Gets a custom (maybe platform-specific) attribute.

Remarks:
This is a nasty way of satisfying any API's need to see platform-specific details. It horrid, but D3D needs this kind of info. At least it's abstracted.
Parameters:
name  The name of the attribute.
pData  Pointer to memory of the right kind of structure to receive the info.

Reimplemented from Ogre::RenderTarget.

int Ogre::RenderTarget::getHeight void    [virtual, inherited]
 

float Ogre::RenderTarget::getLastFPS   [virtual, inherited]
 

Individual stats access - gets the number of frames per second (FPS) based on the last frame rendered.

void Ogre::RenderTarget::getMetrics int &    width,
int &    height,
int &    colourDepth
[virtual, inherited]
 

Retrieve information about the render target.

String Ogre::RenderTarget::getName void    [virtual, inherited]
 

Retrieve target's name.

unsigned short Ogre::RenderTarget::getNumViewports void    [virtual, inherited]
 

Returns the number of viewports attached to this target.

virtual uchar Ogre::RenderTarget::getPriority   const [inline, virtual, inherited]
 

Gets the priority of a render target.

void Ogre::RenderTarget::getStatistics float &    lastFPS,
float &    avgFPS,
float &    bestFPS,
float &    worstFPS
[virtual, inherited]
 

Retieves details of current rendering performance.

Remarks:
If the user application wishes to do it's own performance display, or use performance for some other means, this method allows it to retrieve the statistics.
Parameters:
lastFPS  Pointer to a float to receive the number of frames per second (FPS) based on the last frame rendered.
avgFPS  Pointer to a float to receive the FPS rating based on an average of all the frames rendered since rendering began (the call to RenderSystem::startRendering).
bestFPS  Pointer to a float to receive the best FPS rating that has been achieved since rendering began.
worstFPS  Pointer to a float to receive the worst FPS rating seen so far.

Viewport * Ogre::RenderTarget::getViewport unsigned short    index [virtual, inherited]
 

Retrieves a pointer to the viewport with the given index.

int Ogre::RenderTarget::getWidth void    [virtual, inherited]
 

float Ogre::RenderTarget::getWorstFPS   [virtual, inherited]
 

Individual stats access - gets the worst frames per second (FPS) since call to RenderSystem::startRendering.

bool Ogre::RenderTarget::isActive   const [virtual, inherited]
 

Used to retrieve or set the active state of the render target.

Reimplemented in Ogre::D3D7RenderWindow.

virtual void Ogre::D3D8RenderTexture::outputText int    x,
int    y,
const String   text
[inline, virtual]
 

DEPRECATED Outputs text to the target at the specified co-ordinates.

Implements Ogre::RenderTarget.

void Ogre::RenderTarget::removeAllListeners void    [virtual, inherited]
 

Removes all listeners from this instance.

void Ogre::RenderTarget::removeAllViewports void    [virtual, inherited]
 

Removes all viewports on this target.

void Ogre::RenderTarget::removeListener RenderTargetListener   listener [virtual, inherited]
 

Removes a RenderTargetListener previously registered using addListener.

void Ogre::RenderTarget::removeViewport int    ZOrder [virtual, inherited]
 

Removes a viewport at a given ZOrder.

const String& Ogre::RenderTarget::RenderTarget::getDebugText   const [inherited]
 

Returns the debug text.

bool Ogre::D3D8RenderTexture::requiresTextureFlipping   const [inline, virtual]
 

Implements Ogre::RenderTarget.

void Ogre::RenderTarget::resetStatistics void    [virtual, inherited]
 

Resets saved frame-rate statistices.

void Ogre::RenderTarget::setActive bool    state [virtual, inherited]
 

Used to retrieve the active state of the render target.

Reimplemented in Ogre::D3D9RenderWindow.

void Ogre::RenderTarget::setDebugText const String   text [virtual, inherited]
 

Adds debug text to this window.

virtual void Ogre::RenderTarget::setPriority uchar    priority [inline, virtual, inherited]
 

Sets the priority of this render target in relation to the others.

Remarks:
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.

void Ogre::RenderTarget::setStatsDisplay StatFlags    sf [virtual, inherited]
 

DEPRECATED Set what kind of statistics display (if any) should be displayed by the system about this target.

Remarks:
This method is now DEPRECATED. Use Root::showDebugOverlay instead. OGRE keeps details about the current rendering performance, and can display this on screen if required. This method allows you to specify what should be displayed. Alternatively, the application can retrieve the stats using RenderTarget::getStatistics and report them itself.
Parameters:
sf  Flags indicating which stats to display. Details are in StatFlags

void Ogre::RenderTarget::update void    [virtual, inherited]
 

Tells the target to update it's contents.

Remarks:
If OGRE is not running in an automatic rendering loop (started using RenderSystem::startRendering), the user of the library is responsible for asking each render target to refresh. This is the method used to do this. It automatically re-renders the contents of the target using whatever cameras have been pointed at it (using Camera::setRenderTarget).

This allows OGRE to be used in multi-windowed utilities and for contents to be refreshed only when required, rather than constantly as with the automatic rendering loop.

Reimplemented in Ogre::RenderWindow.

void Ogre::RenderTarget::updateStats void    [protected, inherited]
 

virtual void Ogre::D3D8RenderTexture::writeContentsToFile const String   filename [inline, virtual]
 

Writes the current contents of the render target to the named file.

Implements Ogre::RenderTarget.


Member Data Documentation

bool Ogre::RenderTarget::mActive [protected, inherited]
 

Reimplemented in Ogre::D3D7RenderWindow.

float Ogre::RenderTarget::mAvgFPS [protected, inherited]
 

float Ogre::RenderTarget::mBestFPS [protected, inherited]
 

int Ogre::RenderTarget::mColourDepth [protected, inherited]
 

String Ogre::RenderTarget::mDebugText [protected, inherited]
 

int Ogre::RenderTarget::mHeight [protected, inherited]
 

bool Ogre::RenderTarget::mIsDepthBuffered [protected, inherited]
 

float Ogre::RenderTarget::mLastFPS [protected, inherited]
 

RenderTargetListenerList Ogre::RenderTarget::mListeners [protected, inherited]
 

String Ogre::RenderTarget::mName [protected, inherited]
 

The name of this target.

uchar Ogre::RenderTarget::mPriority [protected, inherited]
 

The priority of the render target.

Texture* Ogre::RenderTexture::mPrivateTex [protected, inherited]
 

The texture to which rendering takes place.

StatFlags Ogre::RenderTarget::mStatFlags [protected, inherited]
 

Texture* Ogre::RenderTexture::mTexture [protected, inherited]
 

The texture that gets accesses by the rest of the API.

unsigned int Ogre::RenderTarget::mTris [protected, inherited]
 

ViewportList Ogre::RenderTarget::mViewportList [protected, inherited]
 

List of viewports, map on Z-order.

int Ogre::RenderTarget::mWidth [protected, inherited]
 

float Ogre::RenderTarget::mWorstFPS [protected, inherited]
 

Copyright © 2002 by The OGRE Team