MCPcopy Create free account
hub / github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator / WndProc

Function WndProc

src/VulkanSample.cpp:2602–2675  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2600 }
2601
2602static LRESULT WINAPI WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
2603{
2604 switch(msg)
2605 {
2606 case WM_DESTROY:
2607 try
2608 {
2609 FinalizeApplication();
2610 }
2611 CATCH_PRINT_ERROR(;)
2612 PostQuitMessage(0);
2613 return 0;
2614
2615 // This prevents app from freezing when left Alt is pressed
2616 // (which normally enters modal menu loop).
2617 case WM_SYSKEYDOWN:
2618 case WM_SYSKEYUP:
2619 return 0;
2620
2621 case WM_SIZE:
2622 if((wParam == SIZE_MAXIMIZED) || (wParam == SIZE_RESTORED))
2623 {
2624 try
2625 {
2626 HandlePossibleSizeChange();
2627 }
2628 CATCH_PRINT_ERROR(DestroyWindow(hWnd);)
2629 }
2630 return 0;
2631
2632 case WM_EXITSIZEMOVE:
2633 try
2634 {
2635 HandlePossibleSizeChange();
2636 }
2637 CATCH_PRINT_ERROR(DestroyWindow(hWnd);)
2638 return 0;
2639
2640 case WM_KEYDOWN:
2641 switch(wParam)
2642 {
2643 case VK_ESCAPE:
2644 PostMessage(hWnd, WM_CLOSE, 0, 0);
2645 break;
2646 case 'T':
2647 try
2648 {
2649 Test();
2650 }
2651 CATCH_PRINT_ERROR(;)
2652 break;
2653 case 'S':
2654 if (g_SparseBindingEnabled)
2655 {
2656 try
2657 {
2658 TestSparseBinding();
2659 }

Callers

nothing calls this directly

Calls 4

FinalizeApplicationFunction · 0.85
HandlePossibleSizeChangeFunction · 0.85
TestFunction · 0.85
TestSparseBindingFunction · 0.85

Tested by

no test coverage detected