Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

# KeosD3D9Window.h

Go to the documentation of this file.

    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     //-----------------------------------------------------------------------
    00033     class CD3D9Window : public IRenderWindow
    00034     {
    00035     public:
    00036
    00039         CD3D9Window();
    00040
    00044                 CD3D9Window(CD3D9* pD3D9);
    00045
    00048         ~CD3D9Window();
    00049
    00052         void Create(const String& strName, uint nWidth, uint nHeight, uint nColourDepth, bool bFullScreen);
    00053
    00056         void Destroy(void);
    00057
    00060         bool IsClosed(void) const;
    00061
    00064         void Reposition(int nLeft, int nTop);
    00065
    00068         void Resize(uint nWidth, uint nHeight);
    00069
    00072         void SwapBuffers(bool bWaitForVSync);
    00073
    00076                 HWND GetWindowHandle() const { return m_HWnd; }
    00077
    00080                 virtual void WindowMovedOrResized(void);
    00081
    00082                 bool IsReady() const { return m_bReady; }
    00083                 void SetReady(bool bSet) { m_bReady = bSet; }
    00084                 void SetActive(bool bSet) { m_bActive = bSet; }
    00085
    00088                 void CreateD3DResources();
    00089
    00092                 virtual void Update(void);
    00093
    00096                 D3DPRESENT_PARAMETERS* GetPresentationParameters(void)
    00097                 { return &m_d3dpp; }
    00098
    00099         protected:
    00100
    00103                 static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
    00104
    00106                 HWND    m_HWnd;
    00108                 bool    m_bReady;
    00110                 bool    m_bClosed;
    00112                 bool    m_bSizing;
    00113
    00114         // Direct3D9 Specific
    00115                 CD3D9* m_pD3D9;
    00116                 D3DPRESENT_PARAMETERS m_d3dpp;
    00117                 LPDIRECT3DSURFACE9 m_pRenderSurface;
    00118                 LPDIRECT3DSURFACE9 m_pRenderZBuffer;
    00119                 D3DMULTISAMPLE_TYPE m_FSAAType;
    00120                 DWORD m_FSAAQuality;
    00121                 bool m_bVSync;
    00122     };
    00123
    00124 } // namespace Keos
    00125
    00126 #endif // KEOS_D3D9WINDOW_H