MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / _process

Method _process

Engine/source/windowManager/win32/win32WindowMgr.cpp:312–396  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

310}
311
312void Win32WindowManager::_process()
313{
314 MSG msg;
315 bool _blocking = false;
316
317 // CodeReview [tom, 4/30/2007] Maintaining two completely separate message
318 // handlers that are essentially the same is silly. The first one never
319 // seems to run as _blocking is hard coded to false above, so is this even
320 // needed ? If it is, this should be rewritten to use the one loop that
321 // adjusts as needed based on _blocking and Journal::IsPlaying()
322
323 if (_blocking && !Journal::IsPlaying())
324 {
325 // In blocking mode, we process one message at a time.
326 if (GetMessage(&msg, NULL, 0, 0))
327 {
328 bool noTranslate = false;
329 Win32Window *w32w = mWindowListHead;
330 while(w32w)
331 {
332 noTranslate = w32w->translateMessage(msg);
333 if(noTranslate) break;
334 w32w = w32w->mNextWindow;
335 }
336
337 if(! noTranslate)
338 {
339 TranslateMessage(&msg);
340 DispatchMessage(&msg);
341 }
342 }
343 else
344 // This should be WM_QUIT
345 Dispatch(ImmediateDispatch,0,msg.message,msg.wParam,msg.lParam);
346 }
347 else
348 {
349 // Process all queued up messages
350 while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
351 {
352 bool translated = false;
353
354// Win32Window *w32w = mWindowListHead;
355// while(w32w)
356// {
357// noTranslate = w32w->translateMessage(msg);
358// if(noTranslate) break;
359// w32w = w32w->mNextWindow;
360// }
361
362 // [tom, 4/30/2007] I think this should work, but leaving the above commented
363 // out just in case this is actually fubared with multiple windows.
364 Win32Window* window = (Win32Window*)(GetWindowLongPtr(msg.hwnd, GWLP_USERDATA));
365 if(window)
366 translated = window->translateMessage(msg);
367
368 if(! translated)
369 {

Callers

nothing calls this directly

Calls 5

IsPlayingFunction · 0.85
DispatchFunction · 0.85
DispatchNextFunction · 0.85
translateMessageMethod · 0.80
triggerMethod · 0.45

Tested by

no test coverage detected