00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00024
00025 #ifndef SFML_WINDOWIMPLWIN32_HPP
00026 #define SFML_WINDOWIMPLWIN32_HPP
00027
00029
00031 #include <SFML/Window/Event.hpp>
00032 #include <SFML/Window/WindowImpl.hpp>
00033 #include <set>
00034 #include <string>
00035
00036
00037 namespace sf_private
00038 {
00042 class sfWindowImplWin32 : public sfWindowImpl
00043 {
00044 public :
00045
00051 sfWindowImplWin32();
00052
00059 sfWindowImplWin32(sfWindowHandle Handle);
00060
00069 sfWindowImplWin32(sfVideoMode Mode, const std::string& Title, bool Fullscreen);
00070
00075 ~sfWindowImplWin32();
00076
00077 private :
00078
00083 virtual void Display();
00084
00089 virtual void ProcessEvents();
00090
00095 virtual void MakeCurrent() const;
00096
00101 virtual void UseVerticalSync(bool Enabled);
00102
00107 virtual void ShowMouseCursor(bool Show);
00108
00113 void RegisterWindowClass();
00114
00122 void CreateContext(sfVideoMode Mode, bool Fullscreen);
00123
00128 void Cleanup();
00129
00138 void ProcessEvent(UINT Message, WPARAM WParam, LPARAM LParam);
00139
00143 void SetupJoysticks();
00144
00153 static sfKey::Code VirtualKeyCodeToSF(WPARAM VirtualKey);
00154
00166 static LRESULT CALLBACK GlobalOnEvent(HWND Handle, UINT Message, WPARAM WParam, LPARAM LParam);
00167
00171 struct JoyCaps
00172 {
00173 int CenterX;
00174 int CenterY;
00175 int CenterZ;
00176 int RangeX;
00177 int RangeY;
00178 int RangeZ;
00179 };
00180
00182
00184 static unsigned int ourWindowCount;
00185 static const wchar_t* ourClassName;
00186 static sfWindowImplWin32* ourDummyWindow;
00187 static sfWindowImplWin32* ourFullscreenWindow;
00188
00190
00192 HWND myHandle;
00193 HDC myDeviceContext;
00194 HGLRC myGLContext;
00195 long myCallback;
00196 JoyCaps myJoystickCaps[2];
00197 };
00198
00199 }
00200
00201 #endif // SFML_WINDOWIMPLWIN32_HPP