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 (c) 2000-2005 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 __D3D7RenderWindow_H__ 00026 #define __D3D7RenderWindow_H__ 00027 00028 // Precompiler options 00029 #include "OgreD3D7Prerequisites.h" 00030 00031 #include "OgreRenderWindow.h" 00032 #include "OgreDDDriver.h" 00033 #include "OgreD3D7DeviceList.h" 00034 #include "OgreD3D7Device.h" 00035 00036 namespace Ogre { 00042 class D3D7RenderWindow : public RenderWindow 00043 { 00044 public: 00045 D3D7RenderWindow(HINSTANCE instance, DDDriver *driver); 00046 ~D3D7RenderWindow(); 00047 00048 void create(const String& name, unsigned int width, unsigned int height, 00049 bool fullScreen, const NameValuePairList *miscParams); 00050 00053 void destroy(void); 00054 00057 bool isActive(void) const; 00058 00061 bool isClosed(void) const; 00062 00065 void reposition(int left, int top); 00066 00069 void resize(unsigned int width, unsigned int height); 00070 00073 void swapBuffers(bool waitForVSync); 00074 00077 HWND getWindowHandle(void) const; 00078 00081 HWND getParentWindowHandle(void) const; 00082 00085 bool isUsingDirectDraw(void) const; 00091 DDDriver* getDirectDrawDriver(void); 00092 00098 LPDIRECTDRAWSURFACE7 getDDFrontBuffer(void); 00099 00103 LPDIRECTDRAWSURFACE7 getDDBackBuffer(void); 00104 00110 LPDIRECT3DDEVICE7 getD3DDevice(void); 00111 00112 bool requiresTextureFlipping() const { return false; } 00113 00116 void getCustomAttribute(const String& name, void* pData); 00117 00120 void writeContentsToFile(const String& filename); 00121 00122 protected: 00123 HINSTANCE mInstance; // Process instance 00124 DDDriver *mDriver; // D3D9 driver 00125 // Win32-specific data members 00126 bool mIsUsingDirectDraw; 00127 HWND mHWnd; // Win32 Window handle 00128 HWND mParentHWnd; 00129 bool mActive; // Is active i.e. visible 00130 bool mReady; // Is ready i.e. available for update 00131 bool mClosed; 00132 00133 RECT rcBlitDest; // Target for blit operation 00134 // == window client area 00135 00136 00137 static LRESULT CALLBACK WndProc( 00138 HWND hWnd, 00139 UINT uMsg, 00140 WPARAM wParam, 00141 LPARAM lParam); 00142 00143 // --------------------------------------------------------- 00144 // DirectX-specific 00145 // --------------------------------------------------------- 00146 00147 // Pointer to DDDriver encapsulating DirectDraw driver (if DirectX in use) 00148 DDDriver* mlpDDDriver; 00149 00150 // Pointers to DX surfaces 00151 LPDIRECTDRAWSURFACE7 mlpDDSFront; // Pointer to primary (front) buffer surface 00152 LPDIRECTDRAWSURFACE7 mlpDDSBack; // Pointer to back buffer 00153 00154 // Pointer to the 3D Device specific for this window 00155 LPDIRECT3DDEVICE7 mlpD3DDevice; 00156 00157 // DirectDraw Methods 00158 void createDDSurfaces(void); 00159 void releaseDDSurfaces(void); 00160 void restoreDDSurfaces(void); 00161 void createDepthBuffer(void); 00162 00163 // Method for dealing with resize / move & 3d library 00164 void windowMovedOrResized(void); 00165 00166 // --------------------------------------------------------- 00167 // OpenGL-specific details 00168 // --------------------------------------------------------- 00169 00170 // TODO 00171 }; 00172 } 00173 #endif
Copyright © 2000-2005 by The OGRE Team
Last modified Wed Feb 23 00:19:04 2005