00001 /* 00002 ----------------------------------------------------------------------------- 00003 This source file is part of OGRE 00004 (Object-oriented Graphics Rendering Engine) 00005 For the latest info, see http://ogre.sourceforge.net/ 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 String name, 00068 int width, int height, 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); 00080 00083 bool isClosed(void); 00084 00087 void reposition(int left, int top); 00088 00091 void resize(int width, int height); 00092 00095 void swapBuffers(bool waitForVSync); 00096 00099 HWND getWindowHandle(void); 00100 00103 HWND getParentWindowHandle(void); 00104 00107 bool isUsingDirectDraw(void); 00113 DDDriver* getDirectDrawDriver(void); 00114 00120 LPDIRECTDRAWSURFACE7 getDDFrontBuffer(void); 00121 00125 LPDIRECTDRAWSURFACE7 getDDBackBuffer(void); 00126 00132 LPDIRECT3DDEVICE7 getD3DDevice(void); 00133 00136 void outputText(int x, int y, const String& text); 00137 00138 bool requiresTextureFlipping() const { return false; } 00139 00142 void getCustomAttribute(String name, void* pData); 00143 00146 void writeContentsToFile(const String& filename); 00147 00148 protected: 00149 // Win32-specific data members 00150 bool mIsUsingDirectDraw; 00151 HWND mHWnd; // Win32 Window handle 00152 HWND mParentHWnd; 00153 bool mActive; // Is active i.e. visible 00154 bool mReady; // Is ready i.e. available for update 00155 bool mClosed; 00156 00157 RECT rcBlitDest; // Target for blit operation 00158 // == window client area 00159 00160 00161 static LRESULT CALLBACK WndProc( 00162 HWND hWnd, 00163 UINT uMsg, 00164 WPARAM wParam, 00165 LPARAM lParam); 00166 00167 // --------------------------------------------------------- 00168 // DirectX-specific 00169 // --------------------------------------------------------- 00170 00171 // Pointer to DDDriver encapsulating DirectDraw driver (if DirectX in use) 00172 DDDriver* mlpDDDriver; 00173 00174 // Pointers to DX surfaces 00175 LPDIRECTDRAWSURFACE7 mlpDDSFront; // Pointer to primary (front) buffer surface 00176 LPDIRECTDRAWSURFACE7 mlpDDSBack; // Pointer to back buffer 00177 00178 // Pointer to the 3D Device specific for this window 00179 LPDIRECT3DDEVICE7 mlpD3DDevice; 00180 00181 // DirectDraw Methods 00182 void createDDSurfaces(void); 00183 void releaseDDSurfaces(void); 00184 void restoreDDSurfaces(void); 00185 void createDepthBuffer(void); 00186 00187 // Method for dealing with resize / move & 3d library 00188 void windowMovedOrResized(void); 00189 00190 // --------------------------------------------------------- 00191 // OpenGL-specific details 00192 // --------------------------------------------------------- 00193 00194 // TODO 00195 }; 00196 } 00197 #endif
Copyright © 2002 by The OGRE Team