diff options
| -rw-r--r-- | demos/cube.c | 11 | ||||
| -rw-r--r-- | demos/tri.c | 11 |
2 files changed, 16 insertions, 6 deletions
diff --git a/demos/cube.c b/demos/cube.c index 9b84cccf..fb21a07b 100644 --- a/demos/cube.c +++ b/demos/cube.c @@ -1923,9 +1923,14 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { demo_run(&demo); break; case WM_SIZE: - demo.width = lParam & 0xffff; - demo.height = lParam & 0xffff0000 >> 16; - demo_resize(&demo); + // Resize the application to the new window size, except when + // it was minimized. Vulkan doesn't support images or swapchains + // with width=0 and height=0. + if (wParam != SIZE_MINIMIZED) { + demo.width = lParam & 0xffff; + demo.height = lParam & 0xffff0000 >> 16; + demo_resize(&demo); + } break; default: break; diff --git a/demos/tri.c b/demos/tri.c index 03378a8b..e059acb5 100644 --- a/demos/tri.c +++ b/demos/tri.c @@ -1522,9 +1522,14 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { break; } case WM_SIZE: - demo.width = lParam & 0xffff; - demo.height = lParam & 0xffff0000 >> 16; - demo_resize(&demo); + // Resize the application to the new window size, except when + // it was minimized. Vulkan doesn't support images or swapchains + // with width=0 and height=0. + if (wParam != SIZE_MINIMIZED) { + demo.width = lParam & 0xffff; + demo.height = lParam & 0xffff0000 >> 16; + demo_resize(&demo); + } break; default: break; |
