aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiers Daniell <pdaniell@nvidia.com>2016-02-18 10:54:15 -0700
committerDustin Graves <dustin@lunarg.com>2016-02-19 16:33:25 -0700
commitc0b6e43c302b7d95059bed4e41d6a50741c9ec0d (patch)
tree0e36a93c55cf05e2ec0b45fbc7af2bfbdd16e3b2
parent6b46df7933591bf13a8032cbf2fb3a0c54c1f529 (diff)
downloadusermoji-c0b6e43c302b7d95059bed4e41d6a50741c9ec0d.tar.xz
Don't use width=0,height=0 on window minimize
Vulkan doesn't support width=0 and height=0 so we just ignore the minimize request on Windows.
-rw-r--r--demos/cube.c11
-rw-r--r--demos/tri.c11
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;