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

# KeosWin32Window.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_WIN32WINDOW_H
    00023 #define KEOS_WIN32WINDOW_H
    00024
    00025 #include "KeosWin32Prerequisites.h"
    00026 #include "KeosRenderWindow.h"
    00027
    00028 namespace Keos
    00029 {
    00030     //-----------------------------------------------------------------------
    00033     class CWin32Window : public IRenderWindow
    00034     {
    00035     public:
    00036
    00039         CWin32Window();
    00040
    00043         ~CWin32Window();
    00044
    00047         void Create(const String& strName, uint nWidth, uint nHeight, uint nColourDepth, bool bFullScreen);
    00048
    00051         void Destroy(void);
    00052
    00055         bool IsClosed(void) const;
    00056
    00059         void Reposition(int nLeft, int nTop);
    00060
    00063         void Resize(uint nWidth, uint nHeight);
    00064
    00067         void SwapBuffers(bool bWaitForVSync);
    00068
    00071                 HWND GetWindowHandle() const { return m_HWnd; }
    00072
    00075                 HDC GetHDC() const { return m_HDC; }
    00076
    00079                 virtual void WindowMovedOrResized(void);
    00080
    00081                 bool IsReady() const { return m_bReady; }
    00082                 void SetReady(bool bSet) { m_bReady = bSet; }
    00083                 void SetActive(bool bSet) { m_bActive = bSet; }
    00084
    00085         protected:
    00086
    00088                 HWND    m_HWnd;
    00090                 HDC             m_HDC;
    00092                 HGLRC   m_Glrc;
    00094                 bool    m_bReady;
    00096                 bool    m_bClosed;
    00097
    00098         //int           m_nOldSwapIntervall;
    00099
    00102                 static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
    00103     };
    00104 } // namespace Keos
    00105
    00106 #endif // KEOS_WIN32WINDOW_H