summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Halase <jordan@halase.me>2019-11-10 10:32:17 -0600
committerJordan Halase <jordan@halase.me>2019-11-10 10:32:17 -0600
commitf5c35ec2ae33a8a752487869a6f9a53f0f5ce5e1 (patch)
tree9d9e73ba86476fae64276c93ae0b73d9ec3bee1f
parent501a5257fe6cc137a0e4ff343779aa32747e1c29 (diff)
Draw after resize
-rwxr-xr-xmain.c25
1 files 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);