00001 /* 00002 ----------------------------------------------------------------------------- 00003 This source file is part of OGRE 00004 (Object-oriented Graphics Rendering Engine) 00005 For the latest info, see http://www.ogre3d.org/ 00006 00007 Copyright © 2000-2002 The OGRE Team 00008 Also see acknowledgements in Readme.html 00009 00010 This program is free software; you can redistribute it and/or modify it under 00011 the terms of the GNU Lesser General Public License as published by the Free Software 00012 Foundation; either version 2 of the License, or (at your option) any later 00013 version. 00014 00015 This program is distributed in the hope that it will be useful, but WITHOUT 00016 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00017 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 00018 00019 You should have received a copy of the GNU Lesser General Public License along with 00020 this program; if not, write to the Free Software Foundation, Inc., 59 Temple 00021 Place - Suite 330, Boston, MA 02111-1307, USA, or go to 00022 http://www.gnu.org/copyleft/lesser.txt. 00023 ----------------------------------------------------------------------------- 00024 */ 00025 #ifndef __D3D9RENDERWINDOW_H__ 00026 #define __D3D9RENDERWINDOW_H__ 00027 00028 #include "OgreD3D9Prerequisites.h" 00029 #include "OgreRenderWindow.h" 00030 #include "OgreD3D9Driver.h" 00031 00032 namespace Ogre 00033 { 00034 class D3D9RenderWindow : public RenderWindow 00035 { 00036 public: 00037 D3D9RenderWindow(); 00038 ~D3D9RenderWindow(); 00039 00040 void create( const String& name, unsigned int width, unsigned int height, unsigned int colourDepth, 00041 bool fullScreen, int left, int top, bool depthBuffer, void* miscParam, ... ); 00042 00043 void destroy(void); 00044 bool isActive() const { return mActive; } 00045 bool isClosed() const { return mClosed; } 00046 void reposition( int left, int top ) {} 00047 void resize( unsigned int width, unsigned int height ); 00048 void swapBuffers( bool waitForVSync = true ); 00049 HWND getWindowHandle() const { return mHWnd; } 00050 HWND getParentWindowHandle() const { return mParentHWnd; } 00051 00052 D3D9Driver* getDirectD3DDriver() { return mpD3DDriver; } 00053 LPDIRECT3DDEVICE9 getD3DDevice() { return mpD3DDevice; } 00054 00055 void getCustomAttribute( const String& name, void* pData ); 00058 void writeContentsToFile(const String& filename); 00059 bool requiresTextureFlipping() const { return false; } 00060 00061 // Method for dealing with resize / move & 3d library 00062 virtual void WindowMovedOrResized(void); 00063 // Method for passing a external window handle before creation ;) 00064 void SetExternalWindowHandle(HWND externalHandle) {mExternalHandle = externalHandle;}; 00065 00066 bool isReady() const { return mReady; } 00067 void setReady(bool set) { mReady = set; } 00068 void setActive(bool set) { mActive = set; } 00069 00070 protected: 00071 HWND mExternalHandle; // External Win32 window handle 00072 HWND mHWnd; // Win32 Window handle 00073 HWND mParentHWnd; // Parent Win32 window handle 00074 bool mActive; // Is active i.e. visible 00075 bool mReady; // Is ready i.e. available for update 00076 bool mClosed; 00077 00078 static LRESULT CALLBACK WndProc( 00079 HWND hWnd, 00080 UINT uMsg, 00081 WPARAM wParam, 00082 LPARAM lParam ); 00083 00084 // ------------------------------------------------------- 00085 // DirectX-specific 00086 // ------------------------------------------------------- 00087 00088 // Pointer to D3DDriver encapsulating Direct3D driver 00089 D3D9Driver* mpD3DDriver; 00090 00091 // Pointer to the 3D device specific for this window 00092 LPDIRECT3DDEVICE9 mpD3DDevice; 00093 D3DPRESENT_PARAMETERS md3dpp; 00094 LPDIRECT3DSURFACE9 mpRenderSurface; 00095 LPDIRECT3DSURFACE9 mpRenderZBuffer; 00096 00097 // just check if the multisampling requested is supported by the device 00098 bool _checkMultiSampleQuality(D3DMULTISAMPLE_TYPE type, DWORD *outQuality, D3DFORMAT format, UINT adapterNum, D3DDEVTYPE deviceType, BOOL fullScreen); 00099 }; 00100 } 00101 #endif
Copyright © 2002-2003 by The OGRE Team
Last modified Sun Nov 28 19:48:21 2004