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 00072 { 00073 return m_HWnd; 00074 } 00075 00078 HDC GetHDC() const 00079 { 00080 return m_HDC; 00081 } 00082 00085 virtual void WindowMovedOrResized(void); 00086 00087 bool IsReady() const 00088 { 00089 return m_bReady; 00090 } 00091 void SetReady(bool bSet) 00092 { 00093 m_bReady = bSet; 00094 } 00095 void SetActive(bool bSet) 00096 { 00097 m_bActive = bSet; 00098 } 00099 00100 protected: 00101 00103 HWND m_HWnd; 00105 HDC m_HDC; 00107 HGLRC m_Glrc; 00109 bool m_bReady; 00111 bool m_bClosed; 00112 00113 //int m_nOldSwapIntervall; 00114 00117 static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 00118 }; 00119 } // namespace Keos 00120 00121 #endif // KEOS_WIN32WINDOW_H
1.5.1-p1