4741
|
1 #ifndef WINDOW_HPP
|
|
2 #define WINDOW_HPP
|
|
3
|
|
4 #include <string>
|
|
5
|
|
6 #define WIN32_LEAN_AND_MEAN
|
|
7 #include <Windows.h>
|
|
8
|
|
9 #include "Video_Mode.hpp"
|
|
10 #include "Window_Listener.hpp"
|
|
11 #include "IMM.hpp"
|
|
12
|
|
13 class Window
|
|
14 {
|
|
15 public:
|
|
16 Window();
|
|
17 ~Window();
|
|
18
|
|
19 void Initialize(const std::wstring &Title, const Video_Mode &Mode, bool Fullscreen);
|
|
20 void Finalize();
|
|
21
|
|
22 void Set_Listener(Window_Listener *Listener);
|
|
23
|
|
24 void Show();
|
|
25 void Hide();
|
|
26
|
|
27 void Handle_Events();
|
|
28 void Display();
|
|
29
|
|
30 void Show_Cursor();
|
|
31 void Hide_Cursor();
|
|
32
|
|
33 HWND Get_Handle();
|
4742
|
34 IMM &Get_IMM();
|
4741
|
35
|
|
36 private:
|
|
37 static const wchar_t *Window_Class_Name;
|
|
38
|
|
39 void Register_Class();
|
|
40 void Unregister_Class();
|
|
41
|
|
42 void Create_Window(const std::wstring &Title, const Video_Mode &Mode, bool Fullscreen);
|
|
43 void Destroy_Window();
|
|
44
|
|
45 void Create_Context(const Video_Mode &Mode);
|
|
46 void Destroy_Context();
|
|
47
|
|
48 void Switch_To_Fullscreen(const Video_Mode &Mode);
|
|
49
|
|
50 LRESULT Handle_Message(HWND Handle, UINT Message, WPARAM wParam, LPARAM lParam);
|
|
51 static LRESULT CALLBACK Window_Procedure(HWND Handle, UINT Message, WPARAM wParam, LPARAM lParam);
|
|
52
|
|
53 HWND my_Handle;
|
|
54 Video_Mode my_Video_Mode;
|
|
55 bool my_Fullscreen;
|
|
56 HDC my_Device_Context;
|
|
57 HGLRC my_GL_Context;
|
|
58 bool my_Class_Registered;
|
|
59 Window_Listener *my_Listener;
|
|
60 IMM my_IMM;
|
|
61 };
|
|
62
|
|
63 #endif
|