MCPcopy Create free account
hub / github.com/davideberly/GeometricTools / MessagePump

Method MessagePump

GTE/Applications/MSW/WindowSystem.h:68–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

GetHandleMethod · 0.80
IsMinimizedMethod · 0.80
OnIdleMethod · 0.45

Tested by

no test coverage detected