| 66 | |
| 67 | template <typename WindowType> |
| 68 | void MessagePump(std::shared_ptr<WindowType> const& window, uint32_t flags) |
| 69 | { |
| 70 | if (window) |
| 71 | { |
| 72 | HWND handle = window->GetHandle(); |
| 73 | ShowWindow(handle, SW_SHOW); |
| 74 | UpdateWindow(handle); |
| 75 | |
| 76 | for (;;) |
| 77 | { |
| 78 | if (flags & NO_IDLE_LOOP) |
| 79 | { |
| 80 | WaitMessage(); |
| 81 | } |
| 82 | |
| 83 | MSG msg; |
| 84 | if (PeekMessage(&msg, nullptr, 0, 0, PM_REMOVE)) |
| 85 | { |
| 86 | if (msg.message == WM_QUIT) |
| 87 | { |
| 88 | break; |
| 89 | } |
| 90 | |
| 91 | TranslateMessage(&msg); |
| 92 | DispatchMessage(&msg); |
| 93 | } |
| 94 | else |
| 95 | { |
| 96 | if (!(flags & NO_IDLE_LOOP)) |
| 97 | { |
| 98 | if (!window->IsMinimized()) |
| 99 | { |
| 100 | window->OnIdle(); |
| 101 | } |
| 102 | } |
| 103 | } |
| 104 | } |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | protected: |
| 109 | // Get the true window size for the specified client size. The true |
nothing calls this directly
no test coverage detected