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

Ogre::D3D7RenderWindow Class Reference

Defines the rendering window on Win32 systems. More...

#include <OgreD3D7RenderWindow.h>

Inheritance diagram for Ogre::D3D7RenderWindow:

Ogre::RenderWindow 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

 D3D7RenderWindow ()
 ~D3D7RenderWindow ()
void create (String name, int width, int height, int colourDepth, bool fullScreen, int left, int top, bool depthBuffer, void *miscParam,...)
 Overridden - see RenderWindow. More...

void destroy (void)
 Overridden - see RenderWindow. More...

bool isActive (void)
 Overridden - see RenderWindow. More...

bool isClosed (void)
 Overridden - see RenderWindow. More...

void reposition (int left, int top)
 Overridden - see RenderWindow. More...

void resize (int width, int height)
 Overridden - see RenderWindow. More...

void swapBuffers (bool waitForVSync)
 Overridden - see RenderWindow. More...

HWND getWindowHandle (void)
 Retrieves a handle to the window (Win32 specific). More...

HWND getParentWindowHandle (void)
 Retrieves a handle to the window's parent, or 0 if there is no parent. More...

bool isUsingDirectDraw (void)
 Returns true if this window is using DirectDraw. More...

DDDrivergetDirectDrawDriver (void)
 Retrieves a pointer to the DirectDraw wrapper object used to manage the window's surface. More...

LPDIRECTDRAWSURFACE7 getDDFrontBuffer (void)
 Returns a pointer to a DirectDraw surface containing the front buffer. More...

LPDIRECTDRAWSURFACE7 getDDBackBuffer (void)
 Returns a pointer to a DirectDraw surface containing the back buffer. More...

LPDIRECT3DDEVICE7 getD3DDevice (void)
 Returns a pointer to the Direct3D device that works with this window. More...

void outputText (int x, int y, const String &text)
 Overridden - see RenderTarget. More...

bool requiresTextureFlipping () const
void getCustomAttribute (String name, void *pData)
 Overridden - see RenderTarget. More...

void writeContentsToFile (const String &filename)
 Overridden - see RenderTarget. More...

virtual void update (void)
 Updates the window contents. More...

virtual bool isFullScreen (void)
 Returns true if window is running in fullscreen mode. More...

virtual void getMetrics (int &width, int &height, int &colourDepth, int &left, int &top)
 Overloaded version of getMetrics from RenderTarget, including extra details specific to windowing systems. More...

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

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

virtual int getWidth (void)
virtual int getHeight (void)
virtual int getColourDepth (void)
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

void createDDSurfaces (void)
void releaseDDSurfaces (void)
void restoreDDSurfaces (void)
void createDepthBuffer (void)
void windowMovedOrResized (void)
void updateStats (void)
virtual void firePreUpdate (void)
 internal method for firing events. More...

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


Static Protected Methods

LRESULT CALLBACK WndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)

Protected Attributes

bool mIsUsingDirectDraw
HWND mHWnd
HWND mParentHWnd
bool mActive
bool mReady
bool mClosed
RECT rcBlitDest
DDDrivermlpDDDriver
LPDIRECTDRAWSURFACE7 mlpDDSFront
LPDIRECTDRAWSURFACE7 mlpDDSBack
LPDIRECT3DDEVICE7 mlpD3DDevice
bool mIsFullScreen
int mLeft
int mTop
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
ViewportList mViewportList
 List of viewports, map on Z-order. More...

RenderTargetListenerList mListeners

Detailed Description

Defines the rendering window on Win32 systems.

Remarks:
This class represents the rendering window on the Windows family of operating systems.


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::D3D7RenderWindow::D3D7RenderWindow  
 

Ogre::D3D7RenderWindow::~D3D7RenderWindow  
 


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::D3D7RenderWindow::create String    name,
int    width,
int    height,
int    colourDepth,
bool    fullScreen,
int    left,
int    top,
bool    depthBuffer,
void *    miscParam,
...   
[virtual]
 

Overridden - see RenderWindow.

Remarks:
In this case there should be 3 parameters in the miscParam group.

miscParam[0] A pointer to a HINSTANCE representing the Win32 instance the window is owned by.

miscParam[1] A pointer to a DDDriver instance representing the DirectDraw driver to be used to manage the window contents. Alternatively, supply 0 to use conventional GDI.

miscParam[2] A pointer to a RenderWindow representing the window that is to be parent to this window (a MDI or child window). Supply 0 to make the window a top-level window.

Implements Ogre::RenderWindow.

void Ogre::D3D7RenderWindow::createDDSurfaces void    [protected]
 

void Ogre::D3D7RenderWindow::createDepthBuffer void    [protected]
 

void Ogre::D3D7RenderWindow::destroy void    [virtual]
 

Overridden - see RenderWindow.

Implements Ogre::RenderWindow.

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

internal method for firing events.

Reimplemented in Ogre::RenderTexture.

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]
 

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

Overridden - see RenderTarget.

Reimplemented from Ogre::RenderTarget.

LPDIRECT3DDEVICE7 Ogre::D3D7RenderWindow::getD3DDevice void   
 

Returns a pointer to the Direct3D device that works with this window.

Note:
Only applicable for windows using DirectDraw.

LPDIRECTDRAWSURFACE7 Ogre::D3D7RenderWindow::getDDBackBuffer void   
 

Returns a pointer to a DirectDraw surface containing the back buffer.

Only applicable if using DirectDraw.

LPDIRECTDRAWSURFACE7 Ogre::D3D7RenderWindow::getDDFrontBuffer void   
 

Returns a pointer to a DirectDraw surface containing the front buffer.

Note:
Only applicable for windows using DirectDraw.

DDDriver * Ogre::D3D7RenderWindow::getDirectDrawDriver void   
 

Retrieves a pointer to the DirectDraw wrapper object used to manage the window's surface.

(Win32 specific)

Note:
Only applicable for windows using DirectDraw.

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.

void Ogre::RenderWindow::getMetrics int &    width,
int &    height,
int &    colourDepth,
int &    left,
int &    top
[virtual, inherited]
 

Overloaded version of getMetrics from RenderTarget, including extra details specific to windowing systems.

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.

HWND Ogre::D3D7RenderWindow::getParentWindowHandle void   
 

Retrieves a handle to the window's parent, or 0 if there is no parent.

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]
 

HWND Ogre::D3D7RenderWindow::getWindowHandle void   
 

Retrieves a handle to the window (Win32 specific).

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.

bool Ogre::D3D7RenderWindow::isActive void    [virtual]
 

Overridden - see RenderWindow.

Reimplemented from Ogre::RenderTarget.

bool Ogre::D3D7RenderWindow::isClosed void    [virtual]
 

Overridden - see RenderWindow.

Implements Ogre::RenderWindow.

bool Ogre::RenderWindow::isFullScreen void    [virtual, inherited]
 

Returns true if window is running in fullscreen mode.

bool Ogre::D3D7RenderWindow::isUsingDirectDraw void   
 

Returns true if this window is using DirectDraw.

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

Overridden - see RenderTarget.

Implements Ogre::RenderTarget.

void Ogre::D3D7RenderWindow::releaseDDSurfaces void    [protected]
 

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.

void Ogre::D3D7RenderWindow::reposition int    left,
int    top
[virtual]
 

Overridden - see RenderWindow.

Implements Ogre::RenderWindow.

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

Implements Ogre::RenderTarget.

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

Resets saved frame-rate statistices.

void Ogre::D3D7RenderWindow::resize int    width,
int    height
[virtual]
 

Overridden - see RenderWindow.

Implements Ogre::RenderWindow.

void Ogre::D3D7RenderWindow::restoreDDSurfaces void    [protected]
 

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::D3D7RenderWindow::swapBuffers bool    waitForVSync [virtual]
 

Overridden - see RenderWindow.

Implements Ogre::RenderWindow.

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

Updates the window contents.

Remarks:
The window is updated by telling each camera which is supposed to render into this window to render it's view, and then the window buffers are swapped via swapBuffers()

Reimplemented from Ogre::RenderTarget.

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

void Ogre::D3D7RenderWindow::windowMovedOrResized void    [protected]
 

LRESULT Ogre::D3D7RenderWindow::WndProc HWND    hWnd,
UINT    uMsg,
WPARAM    wParam,
LPARAM    lParam
[static, protected]
 

void Ogre::D3D7RenderWindow::writeContentsToFile const String   filename [virtual]
 

Overridden - see RenderTarget.

Implements Ogre::RenderTarget.


Member Data Documentation

bool Ogre::D3D7RenderWindow::mActive [protected]
 

Reimplemented from Ogre::RenderTarget.

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

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

bool Ogre::D3D7RenderWindow::mClosed [protected]
 

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

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

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

HWND Ogre::D3D7RenderWindow::mHWnd [protected]
 

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

bool Ogre::RenderWindow::mIsFullScreen [protected, inherited]
 

bool Ogre::D3D7RenderWindow::mIsUsingDirectDraw [protected]
 

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

int Ogre::RenderWindow::mLeft [protected, inherited]
 

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

LPDIRECT3DDEVICE7 Ogre::D3D7RenderWindow::mlpD3DDevice [protected]
 

DDDriver* Ogre::D3D7RenderWindow::mlpDDDriver [protected]
 

LPDIRECTDRAWSURFACE7 Ogre::D3D7RenderWindow::mlpDDSBack [protected]
 

LPDIRECTDRAWSURFACE7 Ogre::D3D7RenderWindow::mlpDDSFront [protected]
 

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

The name of this target.

HWND Ogre::D3D7RenderWindow::mParentHWnd [protected]
 

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

The priority of the render target.

bool Ogre::D3D7RenderWindow::mReady [protected]
 

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

int Ogre::RenderWindow::mTop [protected, inherited]
 

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]
 

RECT Ogre::D3D7RenderWindow::rcBlitDest [protected]
 

Copyright © 2002 by The OGRE Team