29 template <
typename WindowType>
30 std::shared_ptr<WindowType> Create(
typename WindowType::Parameters& parameters);
32 template <
typename WindowType>
33 void Destroy(std::shared_ptr<WindowType>& window);
41 template <
typename WindowType>
42 void MessagePump(std::shared_ptr<WindowType>
const& window,
unsigned int flags);
50 static bool GetWindowRectangle(
int xClientSize,
int yClientSize,
51 DWORD style, RECT& windowRectangle);
59 static void Extract(LPARAM lParam,
int&
x,
int&
y);
60 static void Extract(WPARAM wParam,
int&
x,
int&
y);
63 static LRESULT CALLBACK WindowProcedure(HWND handle,
UINT message, WPARAM wParam, LPARAM lParam);
71 template <
typename WindowType>
74 CreateFrom(parameters);
75 if (parameters.created)
77 std::shared_ptr<WindowType> window = std::make_shared<WindowType>(parameters);
78 mHandleMap[parameters.handle] = window;
79 if (parameters.created)
89 template <
typename WindowType>
94 HWND handle = window->GetHandle();
95 mHandleMap.erase(handle);
97 DestroyWindow(handle);
101 template <
typename WindowType>
106 HWND handle = window->GetHandle();
107 ShowWindow(handle, SW_SHOW);
108 UpdateWindow(handle);
112 if (flags & NO_IDLE_LOOP)
118 if (PeekMessage(&msg,
nullptr, 0, 0, PM_REMOVE))
120 if (msg.message == WM_QUIT)
125 TranslateMessage(&msg);
126 DispatchMessage(&msg);
130 if (!(flags & NO_IDLE_LOOP))
132 if (!window->IsMinimized())
std::map< HWND, std::shared_ptr< MSWWindow > > mHandleMap
void MessagePump(std::shared_ptr< WindowType > const &window, unsigned int flags)
void Destroy(std::shared_ptr< WindowType > &window)
GLuint GLsizei const GLchar * message
std::shared_ptr< WindowType > Create(typename WindowType::Parameters ¶meters)
wchar_t const * mWindowClassName
typedef UINT(WINAPI *PFNWGLGETGPUIDSAMDPROC)(UINT maxCount