From 03982dfd3a7ea0ff4bd3d84aae779de12d96fb5f Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Fri, 6 Mar 2026 14:42:08 -0800 Subject: Emit resize event based on framebuffer size. This accounts for UI scaling --- app/src/app.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/src/app.c b/app/src/app.c index 6eaa3d6..10adcbd 100644 --- a/app/src/app.c +++ b/app/src/app.c @@ -111,6 +111,8 @@ bool gfx_app_run(const GfxAppDesc* desc, const GfxAppCallbacks* callbacks) { LOGE("glfwCreateWindow() failed"); goto cleanup; } + int width, height; + glfwGetFramebufferSize(g_gfx_app.window, &width, &height); glfwMakeContextCurrent(g_gfx_app.window); // Request adaptive sync if supported. @@ -131,8 +133,7 @@ bool gfx_app_run(const GfxAppDesc* desc, const GfxAppCallbacks* callbacks) { } // Trigger an initial resize for convenience. - (*g_gfx_app.callbacks.resize)( - &g_gfx_app, g_gfx_app.app_state, desc->width, desc->height); + (*g_gfx_app.callbacks.resize)(&g_gfx_app, g_gfx_app.app_state, width, height); // Set GLFW callbacks now that the application has been initialized. glfwSetWindowSizeCallback(g_gfx_app.window, on_resize); -- cgit v1.2.3