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 __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(); 00046 ~D3D7RenderWindow(); 00047 00048 00066 void create( 00067 const String& name, 00068 unsigned int width, unsigned int height, unsigned int colourDepth, 00069 bool fullScreen, 00070 int left, int top, 00071 bool depthBuffer, void* miscParam, ... ); 00072 00075 void destroy(void); 00076 00079 bool isActive(void) const; 00080 00083 bool isClosed(void) const; 00084 00087 void reposition(int left, int top); 00088 00091 void resize(unsigned int width, unsigned int height); 00092 00095 void swapBuffers(bool waitForVSync); 00096 00099 HWND getWindowHandle(void) const; 00100 00103 HWND getParentWindowHandle(void) const; 00104 00107 bool isUsingDirectDraw(void) const; 00113 DDDriver* getDirectDrawDriver(void); 00114 00120 LPDIRECTDRAWSURFACE7 getDDFrontBuffer(void); 00121 00125 LPDIRECTDRAWSURFACE7 getDDBackBuffer(void); 00126 00132 LPDIRECT3DDEVICE7 getD3DDevice(void); 00133 00134 bool requiresTextureFlipping() const { return false; } 00135 00138 void getCustomAttribute(const String& name, void* pData); 00139 00142 void writeContentsToFile(const String& filename); 00143 00144 protected: 00145 // Win32-specific data members 00146 bool mIsUsingDirectDraw; 00147 HWND mHWnd; // Win32 Window handle 00148 HWND mParentHWnd; 00149 bool mActive; // Is active i.e. visible 00150 bool mReady; // Is ready i.e. available for update 00151 bool mClosed; 00152 00153 RECT rcBlitDest; // Target for blit operation 00154 // == window client area 00155 00156 00157 static LRESULT CALLBACK WndProc( 00158 HWND hWnd, 00159 UINT uMsg, 00160 WPARAM wParam, 00161 LPARAM lParam); 00162 00163 // --------------------------------------------------------- 00164 // DirectX-specific 00165 // --------------------------------------------------------- 00166 00167 // Pointer to DDDriver encapsulating DirectDraw driver (if DirectX in use) 00168 DDDriver* mlpDDDriver; 00169 00170 // Pointers to DX surfaces 00171 LPDIRECTDRAWSURFACE7 mlpDDSFront; // Pointer to primary (front) buffer surface 00172 LPDIRECTDRAWSURFACE7 mlpDDSBack; // Pointer to back buffer 00173 00174 // Pointer to the 3D Device specific for this window 00175 LPDIRECT3DDEVICE7 mlpD3DDevice; 00176 00177 // DirectDraw Methods 00178 void createDDSurfaces(void); 00179 void releaseDDSurfaces(void); 00180 void restoreDDSurfaces(void); 00181 void createDepthBuffer(void); 00182 00183 // Method for dealing with resize / move & 3d library 00184 void windowMovedOrResized(void); 00185 00186 // --------------------------------------------------------- 00187 // OpenGL-specific details 00188 // --------------------------------------------------------- 00189 00190 // TODO 00191 }; 00192 } 00193 #endif
Copyright © 2002-2003 by The OGRE Team
Last modified Sun Nov 28 19:48:19 2004