00001 00002 // 00003 // SFML - Simple and Fast Multimedia Library 00004 // Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com) 00005 // 00006 // This software is provided 'as-is', without any express or implied warranty. 00007 // In no event will the authors be held liable for any damages arising from the use of this software. 00008 // 00009 // Permission is granted to anyone to use this software for any purpose, 00010 // including commercial applications, and to alter it and redistribute it freely, 00011 // subject to the following restrictions: 00012 // 00013 // 1. The origin of this software must not be misrepresented; 00014 // you must not claim that you wrote the original software. 00015 // If you use this software in a product, an acknowledgment 00016 // in the product documentation would be appreciated but is not required. 00017 // 00018 // 2. Altered source versions must be plainly marked as such, 00019 // and must not be misrepresented as being the original software. 00020 // 00021 // 3. This notice may not be removed or altered from any source distribution. 00022 // 00024 00025 #ifndef SFML_WINDOWIMPLWIN32_HPP 00026 #define SFML_WINDOWIMPLWIN32_HPP 00027 00029 // Headers 00031 #include <SFML/Window/Event.hpp> 00032 #include <SFML/Window/WindowImpl.hpp> 00033 #include <windows.h> 00034 #include <string> 00035 00036 00037 namespace sf 00038 { 00039 namespace priv 00040 { 00044 class WindowImplWin32 : public WindowImpl 00045 { 00046 public : 00047 00053 WindowImplWin32(); 00054 00062 WindowImplWin32(WindowHandle Handle, WindowSettings& Params); 00063 00073 WindowImplWin32(VideoMode Mode, const std::string& Title, unsigned long WindowStyle, WindowSettings& Params); 00074 00079 ~WindowImplWin32(); 00080 00087 static bool IsContextActive(); 00088 00089 private : 00090 00095 virtual void ProcessEvents(); 00096 00101 virtual void Display(); 00102 00107 virtual void SetActive(bool Active = true) const; 00108 00113 virtual void UseVerticalSync(bool Enabled); 00114 00119 virtual void ShowMouseCursor(bool Show); 00120 00125 virtual void SetCursorPosition(unsigned int Left, unsigned int Top); 00126 00131 virtual void SetPosition(int Left, int Top); 00132 00137 virtual void SetSize(unsigned int Width, unsigned int Height); 00138 00143 virtual void Show(bool State); 00144 00149 virtual void EnableKeyRepeat(bool Enabled); 00150 00155 virtual void SetIcon(unsigned int Width, unsigned int Height, const Uint8* Pixels); 00156 00161 void RegisterWindowClass(); 00162 00169 void SwitchToFullscreen(const VideoMode& Mode); 00170 00178 void CreateContext(const VideoMode& Mode, WindowSettings& Params); 00179 00184 void Cleanup(); 00185 00194 void ProcessEvent(UINT Message, WPARAM WParam, LPARAM LParam); 00195 00205 static Key::Code GetShiftState(bool KeyDown); 00206 00216 static Key::Code VirtualKeyCodeToSF(WPARAM VirtualKey, LPARAM Flags); 00217 00226 static bool HasUnicodeSupport(); 00227 00239 static LRESULT CALLBACK GlobalOnEvent(HWND Handle, UINT Message, WPARAM WParam, LPARAM LParam); 00240 00242 // Static member data 00244 static unsigned int ourWindowCount; 00245 static const char* ourClassNameA; 00246 static const wchar_t* ourClassNameW; 00247 static WindowImplWin32* ourFullscreenWindow; 00248 00250 // Member data 00252 HWND myHandle; 00253 long myCallback; 00254 HCURSOR myCursor; 00255 HICON myIcon; 00256 bool myKeyRepeatEnabled; 00257 bool myIsCursorIn; 00258 HDC myDeviceContext; 00259 HGLRC myGLContext; 00260 }; 00261 00262 } // namespace priv 00263 00264 } // namespace sf 00265 00266 #endif // SFML_WINDOWIMPLWIN32_HPP
:: Copyright © 2007-2008 Laurent Gomila, all rights reserved :: Documentation generated by doxygen 1.5.2 ::