diff options
author | Jordan Halase <jordan@halase.me> | 2019-11-10 10:32:17 -0600 |
---|---|---|
committer | Jordan Halase <jordan@halase.me> | 2019-11-10 10:32:17 -0600 |
commit | f5c35ec2ae33a8a752487869a6f9a53f0f5ce5e1 (patch) | |
tree | 9d9e73ba86476fae64276c93ae0b73d9ec3bee1f | |
parent | 501a5257fe6cc137a0e4ff343779aa32747e1c29 (diff) |
Draw after resize
-rwxr-xr-x | main.c | 25 |
1 files changed, 13 insertions, 12 deletions
@@ -1748,18 +1748,6 @@ struct Arguments args; uint32_t framesDrawn; -static bool shouldResize(const struct RenderVulkan *vk, const PuglEvent *e) -{ - const struct SwapchainVulkan *swapchain = vk->swapchain; - return (swapchain->extent.width != e->configure.width) || - (swapchain->extent.height != e->configure.height); -} - -static PuglStatus onResize(struct RenderVulkan *vk, uint32_t width, uint32_t height) -{ - CHECK_RVK(vk, rvkCreateSwapchain(vk, width, height)); -} - PuglStatus onDisplay(PuglView *view) { struct RenderVulkan *vk = puglGetHandle(view); @@ -1837,6 +1825,19 @@ PuglStatus onDisplay(PuglView *view) return PUGL_SUCCESS; } +static bool shouldResize(const struct RenderVulkan *vk, const PuglEvent *e) +{ + const struct SwapchainVulkan *swapchain = vk->swapchain; + return (swapchain->extent.width != e->configure.width) || + (swapchain->extent.height != e->configure.height); +} + +static PuglStatus onResize(struct RenderVulkan *vk, uint32_t width, uint32_t height) +{ + CHECK_RVK(vk, rvkCreateSwapchain(vk, width, height)); + return onDisplay(vk->view); +} + PuglStatus onEvent(PuglView *view, const PuglEvent *e) { printEvent(e, "Event:\t", args.verbose); |