MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Blast / MsgProc

Method MsgProc

samples/SampleBase/core/DeviceManager.cpp:403–462  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

401}
402
403LRESULT
404DeviceManager::MsgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
405{
406 switch(uMsg)
407 {
408 case WM_DESTROY:
409 case WM_CLOSE:
410 PostQuitMessage(0);
411 return 0;
412
413 case WM_SYSKEYDOWN:
414 if(wParam == VK_F4)
415 {
416 PostQuitMessage(0);
417 return 0;
418 }
419 break;
420
421 case WM_ENTERSIZEMOVE:
422 m_InSizingModalLoop = true;
423 m_NewWindowSize.cx = m_SwapChainDesc.BufferDesc.Width;
424 m_NewWindowSize.cy = m_SwapChainDesc.BufferDesc.Height;
425 break;
426
427 case WM_EXITSIZEMOVE:
428 m_InSizingModalLoop = false;
429 ResizeSwapChain();
430 break;
431
432 case WM_SIZE:
433 // Ignore the WM_SIZE event if there is no device,
434 // or if the window has been minimized (size == 0),
435 // or if it has been restored to the previous size (this part is tested inside ResizeSwapChain)
436 if (m_Device && (lParam != 0))
437 {
438 m_NewWindowSize.cx = LOWORD(lParam);
439 m_NewWindowSize.cy = HIWORD(lParam);
440
441 if(!m_InSizingModalLoop)
442 ResizeSwapChain();
443 }
444 }
445
446 if( uMsg >= WM_MOUSEFIRST && uMsg <= WM_MOUSELAST ||
447 uMsg >= WM_KEYFIRST && uMsg <= WM_KEYLAST )
448 {
449 // processing messages front-to-back
450 for(auto it = m_vControllers.begin(); it != m_vControllers.end(); it++)
451 {
452 if((*it)->IsEnabled())
453 {
454 // for kb/mouse messages, 0 means the message has been handled
455 if(0 == (*it)->MsgProc(hWnd, uMsg, wParam, lParam))
456 return 0;
457 }
458 }
459 }
460

Callers 1

WindowProcFunction · 0.45

Calls 1

IsEnabledMethod · 0.80

Tested by

no test coverage detected