00001 /* 00002 This file is part of c0re. 00003 00004 c0re is a multiplayer RTS on a hexagonal map with an evolving unit concept. 00005 Copyright (C) 2007 Stephan Hofmann 00006 00007 c0re is free software: you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation, either version 3 of the License, or 00010 (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program. If not, see <http://www.gnu.org/licenses/>. 00019 */ 00020 00021 #ifndef _WINDOW_H_ 00022 #define _WINDOW_H_ 00023 00024 #include "InputContext.h" 00025 00026 #include <string> 00027 #include <map> 00028 00029 #include "system.h" 00030 #include "Vector3i.h" 00031 00035 class Window : public InputContext 00036 { 00037 public: 00041 Window(); 00042 00046 virtual ~Window(); 00047 00051 virtual void switchFullscreen(); 00052 00058 virtual int swapBuffers(); 00059 00065 virtual int makeCurrent(); 00066 00072 virtual int killWindow(); 00073 00084 virtual HWND createWindow(std::string name, int p_height, int p_width, int depth, bool p_fullscreen); 00085 00091 virtual int clearCurrent(); 00092 00098 int checkMessages(); 00099 00105 virtual int BuildFont(); 00106 00114 static LRESULT CALLBACK WndProc(HWND hWnd,UINT uMsg, WPARAM wParam, LPARAM lParam); 00115 00119 static std::map<HWND, Window*> openWindows; 00120 00124 int width; 00125 00129 int height; 00130 00134 Vector3i mousePos; 00135 00139 std::map<int, std::string> scancodes; 00140 00141 00142 protected: 00146 HGLRC hRC; 00147 00151 HDC hDC; 00152 00156 HWND hWnd; 00157 00161 HINSTANCE hInstance; 00162 00166 bool fullscreen; 00167 00168 }; 00169 00170 #endif