00001 /* 00002 * This source file is part of KEOS (Free 3D Engine) 00003 * For the latest info, see http://www.keosengine.org/ 00004 * E-mails : thierry.vouriot@keosengine.org, yeri@keosengine.org 00005 * 00006 * This program is free software; you can redistribute it and/or modify it under 00007 * the terms of the GNU Lesser General Public License as published by the Free Software 00008 * Foundation; either version 2 of the License, or (at your option) any later 00009 * version. 00010 * 00011 * This program is distributed in the hope that it will be useful, but WITHOUT 00012 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00013 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU Lesser General Public License along with 00016 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple 00017 * Place - Suite 330, Boston, MA 02111-1307, USA, or go to 00018 * http://www.gnu.org/copyleft/lesser.txt. 00019 * 00020 */ 00021 00022 #ifndef KEOS_D3D9WINDOW_H 00023 #define KEOS_D3D9WINDOW_H 00024 00025 #include "KeosD3D9Prerequisites.h" 00026 #include "KeosRenderWindow.h" 00027 00028 namespace Keos 00029 { 00030 //----------------------------------------------------------------------- 00034 class CD3D9Window : public IRenderWindow 00035 { 00036 public: 00037 00040 CD3D9Window(); 00041 00045 CD3D9Window(CD3D9* pD3D9); 00046 00049 ~CD3D9Window(); 00050 00053 void Create(const String& strName, uint nWidth, uint nHeight, uint nColourDepth, bool bFullScreen); 00054 00057 void Destroy(void); 00058 00061 bool IsClosed(void) const; 00062 00065 void Reposition(int nLeft, int nTop); 00066 00069 void Resize(uint nWidth, uint nHeight); 00070 00073 void SwapBuffers(bool bWaitForVSync); 00074 00077 HWND GetWindowHandle() const 00078 { 00079 return m_HWnd; 00080 } 00081 00084 virtual void WindowMovedOrResized(void); 00085 00086 bool IsReady() const 00087 { 00088 return m_bReady; 00089 } 00090 void SetReady(bool bSet) 00091 { 00092 m_bReady = bSet; 00093 } 00094 void SetActive(bool bSet) 00095 { 00096 m_bActive = bSet; 00097 } 00098 00101 void CreateD3DResources(); 00102 00105 virtual void Update(void); 00106 00109 D3DPRESENT_PARAMETERS* GetPresentationParameters(void) 00110 { 00111 return &m_d3dpp; 00112 } 00113 00114 protected: 00115 00118 static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 00119 00121 HWND m_HWnd; 00123 bool m_bReady; 00125 bool m_bClosed; 00127 bool m_bSizing; 00128 00129 // Direct3D9 Specific 00130 CD3D9* m_pD3D9; 00131 D3DPRESENT_PARAMETERS m_d3dpp; 00132 LPDIRECT3DSURFACE9 m_pRenderSurface; 00133 LPDIRECT3DSURFACE9 m_pRenderZBuffer; 00134 D3DMULTISAMPLE_TYPE m_FSAAType; 00135 DWORD m_FSAAQuality; 00136 bool m_bVSync; 00137 }; 00138 00139 } // namespace Keos 00140 00141 #endif // KEOS_D3D9WINDOW_H
1.5.1-p1