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

OgreD3D9RenderWindow.h

Go to the documentation of this file.
00001 #ifndef __D3D9RENDERWINDOW_H__
00002 #define __D3D9RENDERWINDOW_H__
00003 
00004 // Precompiler options
00005 #include "OgreD3D9Prerequisites.h"
00006 
00007 #include "OgreRenderWindow.h"
00008 #include "OgreD3D9Driver.h"
00009 
00010 #include "OgreNoMemoryMacros.h"
00011 //#include "d3dfont.h"
00012 #include "OgreMemoryMacros.h"
00013 
00014 namespace Ogre 
00015 {
00016     class D3D9RenderWindow : public RenderWindow
00017     {
00018     public:
00019         D3D9RenderWindow();
00020         ~D3D9RenderWindow();
00021 
00022         void create( String name, int width, int height, int colourDepth,
00023             bool fullScreen, int left, int top, bool depthBuffer, void* miscParam, ... );
00024 
00025         void destroy(void);
00026         bool isActive() { return mActive; }
00027         bool isClosed() { return mClosed; }
00028         void reposition( int left, int top ) {}
00029         void resize( int width, int height );
00030         void swapBuffers( bool waitForVSync = true );
00031         HWND getWindowHandle() { return mHWnd; }
00032         HWND getParentWindowHandle() { return mParentHWnd; }
00033 
00034         D3D9Driver* getDirectD3DDriver() { return mpD3DDriver; }
00035         LPDIRECT3DDEVICE9 getD3DDevice() { return mpD3DDevice; }
00036 
00037         void outputText( int x, int ty, const String& text );
00038         void getCustomAttribute( String name, void* pData );
00041         void writeContentsToFile(const String& filename);
00042         bool requiresTextureFlipping() const { return false; }
00043 
00044         // Method for getting multisample (anti aliasing) quality currently in use
00045         DWORD getMultiSampleQuality(){return mMultiSampleQuality;};
00046         // Method for dealing with resize / move & 3d library
00047         void WindowMovedOrResized(void);
00048         // Method for passing a external window handle before creation ;)
00049         void SetExternalWindowHandle(HWND externalHandle) {mExternalHandle = externalHandle;};
00050 
00051         bool isReady() { return mReady; }
00052         void setReady(bool set) { mReady = set; }
00053         void setActive(bool set) { mActive = set; }
00054 
00055     protected:
00056         HWND    mExternalHandle;        // External Win32 window handle
00057         HWND    mHWnd;                  // Win32 Window handle
00058         HWND    mParentHWnd;            // Parent Win32 window handle
00059         bool    mActive;                // Is active i.e. visible
00060         bool    mReady;                 // Is ready i.e. available for update
00061         bool    mClosed;
00062         DWORD   mMultiSampleQuality;
00063 
00064         static LRESULT CALLBACK WndProc(
00065             HWND hWnd,
00066             UINT uMsg,
00067             WPARAM wParam,
00068             LPARAM lParam );
00069 
00070         // -------------------------------------------------------
00071         // DirectX-specific
00072         // -------------------------------------------------------
00073 
00074         // Pointer to D3DDriver encapsulating Direct3D driver
00075         D3D9Driver* mpD3DDriver;
00076 
00077         // Pointer to the 3D device specific for this window
00078         LPDIRECT3DDEVICE9   mpD3DDevice;
00079         D3DPRESENT_PARAMETERS md3dpp;
00080         LPDIRECT3DSURFACE9 mpRenderSurface;
00081         LPDIRECT3DSURFACE9 mpRenderZBuffer;
00082 
00083         // just check if the multisampling requested is supported by the device
00084         bool _checkMultiSampleQuality(D3DMULTISAMPLE_TYPE type, DWORD *outQuality, D3DFORMAT fBack, D3DFORMAT fDepth, UINT adapterNum, D3DDEVTYPE deviceType, BOOL fullScreen);
00085     };
00086 }
00087 #endif

Copyright © 2002 by The OGRE Team