Ocular Engine
WindowWin32.hpp
1 
17 #pragma once
18 #ifndef __H__OCULAR_RENDERER_WIN_WINDOW__H__
19 #define __H__OCULAR_RENDERER_WIN_WINDOW__H__
20 
21 #include "Common.hpp"
22 #include "Window.hpp"
23 
24 #ifdef OCULAR_WINDOWS
25 #include <Windows.h>
26 
27 //------------------------------------------------------------------------------------------
28 
33 namespace Ocular
34 {
39  namespace Core
40  {
47  class WindowWin32 : public AWindow
48  {
49  public:
50 
61  WindowWin32(WindowDescriptor const& descriptor);
62 
66  WindowWin32(WindowDescriptor const& descriptor, void* windowID);
67 
68  virtual ~WindowWin32();
69 
74  virtual void showCursor(bool show) override;
75 
80  HWND getHWND() const;
81 
86  HINSTANCE getHINSTANCE() const;
87 
99  LRESULT CALLBACK processMessage(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
100 
101  protected:
102 
106  void open();
107 
111  void connect();
112 
116  void update(uint64_t time);
117 
121  void close();
122 
123  private:
124 
128  RECT createWindowRect();
129 
134  WNDCLASS createWndClass(WNDPROC wndProc);
135 
139  void registerRawInput();
140 
144  void handleRawKeyboardInput(RAWKEYBOARD const& data);
145 
149  void handleRawMouseInput(RAWMOUSE const& data);
150 
154  void handleRawMouseButtonInput(RAWMOUSE const& data);
155 
159  void handleRawMouseMoveInput(RAWMOUSE const& data);
160 
161  //------------------------------------------------------------
162 
163  HWND m_HWND;
164  HINSTANCE m_HINSTANCE;
165 
166  RAWINPUTDEVICE m_RawDevices[2];
167  };
168  }
172 }
177 //------------------------------------------------------------------------------------------
178 
179 #endif // OCULAR_WINDOWS
180 #endif // __H__OCULAR_RENDERER_WIN_WINDOW__H__
Note: Once this library is made dynamic, this will no longer be needed.
Definition: Common.hpp:70