From f5c35ec2ae33a8a752487869a6f9a53f0f5ce5e1 Mon Sep 17 00:00:00 2001 From: Jordan Halase Date: Sun, 10 Nov 2019 10:32:17 -0600 Subject: Draw after resize --- main.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/main.c b/main.c index 4572828..3903579 100755 --- a/main.c +++ b/main.c @@ -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); -- cgit v1.2.1