From 0b0067cb0a8db5ea5178501a12aacdef436a9845 Mon Sep 17 00:00:00 2001 From: skal Date: Mon, 2 Feb 2026 09:19:17 +0100 Subject: feat(platform): Fix high-DPI scaling and add resolution option - Fixed a 'squished' viewport bug on high-DPI (Retina) displays by querying the framebuffer size in pixels instead of using the window size in points. - Centralized window dimension management within the platform layer. - Added a '--resolution WxH' command-line option to allow specifying a custom window size at startup. This option is stripped in STRIP_ALL builds. - Updated all test and tool executables to use the new platform API. --- src/platform.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/platform.h') diff --git a/src/platform.h b/src/platform.h index 9cfaf00..38a0568 100644 --- a/src/platform.h +++ b/src/platform.h @@ -6,16 +6,20 @@ #include +// Forward declare GLFWwindow to avoid including the full header here. struct GLFWwindow; -void platform_init_window(bool fullscreen); +void platform_init_window(bool fullscreen, int* width_ptr, int* height_ptr); void platform_shutdown(); void platform_poll(); bool platform_should_close(); -void platform_toggle_fullscreen(); - GLFWwindow* platform_get_window(); double platform_get_time(); +// Add dimension getters +int platform_get_width(); +int platform_get_height(); +float platform_get_aspect_ratio(); + WGPUSurface platform_create_wgpu_surface(WGPUInstance instance); -- cgit v1.2.3